ccjk 14.2.1 → 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 (526) 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 -1390
  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 -234
  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 -232
  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.8oaxX4iR.mjs +0 -90
  309. package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
  310. package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
  311. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  312. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  313. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  314. package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
  315. package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
  316. package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
  317. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  318. package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
  319. package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
  320. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  321. package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
  322. package/dist/shared/ccjk.C1Be3aJN.mjs +0 -254
  323. package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
  324. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  325. package/dist/shared/ccjk.C94P8gCY.mjs +0 -283
  326. package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
  327. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  328. package/dist/shared/ccjk.CTr4yCZ1.mjs +0 -225
  329. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  330. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  331. package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
  332. package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
  333. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  334. package/dist/shared/ccjk.D-magaEx.mjs +0 -763
  335. package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
  336. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  337. package/dist/shared/ccjk.D75wivnp.mjs +0 -142
  338. package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
  339. package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
  340. package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
  341. package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
  342. package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
  343. package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
  344. package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
  345. package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
  346. package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
  347. package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
  348. package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
  349. package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
  350. package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
  351. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  352. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  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/dhh-mode.md +0 -265
  378. package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  379. package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  380. package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  381. package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  382. package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  383. package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  384. package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  385. package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  386. package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  387. package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  388. package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  389. package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  390. package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  391. package/dist/templates/common/workflow/essential/en/feat.md +0 -92
  392. package/dist/templates/common/workflow/essential/en/goal.md +0 -147
  393. package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
  394. package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  395. package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  396. package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  397. package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  398. package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  399. package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  400. package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  401. package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
  402. package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
  403. package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
  404. package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  405. package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  406. package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  407. package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  408. package/dist/templates/common/workflow/interview/en/interview.md +0 -67
  409. package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  410. package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  411. package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  412. package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  413. package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  414. package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
  415. package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  416. package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  417. package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  418. package/dist/templates/hooks/README.md +0 -212
  419. package/dist/templates/hooks/git-workflow-hooks.md +0 -551
  420. package/dist/templates/hooks/post-test/coverage.json +0 -21
  421. package/dist/templates/hooks/post-test/summary.json +0 -21
  422. package/dist/templates/hooks/post-test-coverage.md +0 -434
  423. package/dist/templates/hooks/pre-commit/eslint.json +0 -22
  424. package/dist/templates/hooks/pre-commit/prettier.json +0 -22
  425. package/dist/templates/hooks/pre-commit-black.md +0 -274
  426. package/dist/templates/hooks/pre-commit-eslint.md +0 -153
  427. package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
  428. package/dist/templates/hooks/pre-commit-prettier.md +0 -212
  429. package/dist/templates/hooks/pre-commit-type-check.md +0 -377
  430. package/dist/templates/skills/ccjk-init.md +0 -154
  431. package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
  432. package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
  433. package/dist/templates/skills/django-patterns.md +0 -1016
  434. package/dist/templates/skills/git-workflow.md +0 -748
  435. package/dist/templates/skills/go-idioms.md +0 -963
  436. package/dist/templates/skills/index.json +0 -132
  437. package/dist/templates/skills/nextjs-optimization.md +0 -694
  438. package/dist/templates/skills/python-pep8.md +0 -852
  439. package/dist/templates/skills/react-patterns.md +0 -686
  440. package/dist/templates/skills/rust-patterns.md +0 -1057
  441. package/dist/templates/skills/security-best-practices.md +0 -1413
  442. package/dist/templates/skills/testing-best-practices.md +0 -1315
  443. package/dist/templates/skills/ts-best-practices.md +0 -354
  444. package/templates/agents/README.md +0 -78
  445. package/templates/agents/fullstack-developer.json +0 -70
  446. package/templates/agents/go-expert.json +0 -69
  447. package/templates/agents/index.json +0 -64
  448. package/templates/agents/python-expert.json +0 -69
  449. package/templates/agents/react-specialist.json +0 -69
  450. package/templates/agents/testing-automation-expert.json +0 -70
  451. package/templates/agents/typescript-architect.json +0 -69
  452. package/templates/claude-code/common/settings.json +0 -109
  453. package/templates/common/error-prevention.md +0 -267
  454. package/templates/common/karpathy-baseline.md +0 -83
  455. package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  456. package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  457. package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  458. package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  459. package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  460. package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  461. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  462. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  463. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  464. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  465. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  466. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  467. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  468. package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  469. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  470. package/templates/common/workflow/essential/en/feat.md +0 -92
  471. package/templates/common/workflow/essential/en/goal.md +0 -147
  472. package/templates/common/workflow/essential/en/init-project.md +0 -53
  473. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  474. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  475. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  476. package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  477. package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  478. package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  479. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  480. package/templates/common/workflow/git/en/git-commit.md +0 -205
  481. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  482. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  483. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  484. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  485. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  486. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  487. package/templates/common/workflow/interview/en/interview.md +0 -67
  488. package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  489. package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  490. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  491. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  492. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  493. package/templates/common/workflow/sixStep/en/workflow.md +0 -83
  494. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  495. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  496. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  497. package/templates/hooks/README.md +0 -212
  498. package/templates/hooks/git-workflow-hooks.md +0 -551
  499. package/templates/hooks/post-test/coverage.json +0 -21
  500. package/templates/hooks/post-test/summary.json +0 -21
  501. package/templates/hooks/post-test-coverage.md +0 -434
  502. package/templates/hooks/pre-commit/eslint.json +0 -22
  503. package/templates/hooks/pre-commit/prettier.json +0 -22
  504. package/templates/hooks/pre-commit-black.md +0 -274
  505. package/templates/hooks/pre-commit-eslint.md +0 -153
  506. package/templates/hooks/pre-commit-gofmt.md +0 -284
  507. package/templates/hooks/pre-commit-prettier.md +0 -212
  508. package/templates/hooks/pre-commit-type-check.md +0 -377
  509. package/templates/skills/basic.hbs +0 -72
  510. package/templates/skills/ccjk-init.md +0 -154
  511. package/templates/skills/ccjk-mcp-setup.md +0 -205
  512. package/templates/skills/ccjk-troubleshoot.md +0 -228
  513. package/templates/skills/code-refactor.hbs +0 -133
  514. package/templates/skills/code-review.hbs +0 -141
  515. package/templates/skills/django-patterns.md +0 -1016
  516. package/templates/skills/git-workflow.md +0 -748
  517. package/templates/skills/go-idioms.md +0 -963
  518. package/templates/skills/index.json +0 -132
  519. package/templates/skills/nextjs-optimization.md +0 -694
  520. package/templates/skills/python-pep8.md +0 -852
  521. package/templates/skills/react-patterns.md +0 -686
  522. package/templates/skills/rust-patterns.md +0 -1057
  523. package/templates/skills/security-best-practices.md +0 -1413
  524. package/templates/skills/testing-best-practices.md +0 -1315
  525. package/templates/skills/ts-best-practices.md +0 -354
  526. package/templates/skills/type-fix.hbs +0 -132
@@ -1,1301 +0,0 @@
1
- import { existsSync, mkdirSync, statSync, writeFileSync, readFileSync, readdirSync } 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 { getApiProviderPresets } from './api-providers.mjs';
6
- import { SETTINGS_FILE, CLAUDE_DIR, CODEX_DIR, CODEX_CONFIG_FILE, getCodeToolRuntimeCommand } from './constants.mjs';
7
- import { i18n } from './index2.mjs';
8
- import { g as getPermissionManager } from '../shared/ccjk.DsZsc4LR.mjs';
9
- import { i as isCcrInstalled } from '../shared/ccjk.DFRPtmK_.mjs';
10
- import { i as inspectClaudeFamilyCoreFeatures } from '../shared/ccjk.C1Be3aJN.mjs';
11
- import { a as readCodexConfig, g as readCodexGoalsFeatureEnabled } from './codex.mjs';
12
- import { b as backupExistingConfig, c as copyConfigFiles } from './config.mjs';
13
- import { c as commandExists } from './platform.mjs';
14
- import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
15
- import { r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.DDL-4C-k.mjs';
16
- import { platform, userInfo, homedir } from 'node:os';
17
- import ora from './index8.mjs';
18
- import { exec as q } from './main.mjs';
19
- import { STATUS } from './banner.mjs';
20
- import { writeFileAtomic } from './fs-operations.mjs';
21
- import { c as resolve, j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
22
- import '../shared/ccjk.BAGoDD49.mjs';
23
- import 'node:readline';
24
- import 'stream';
25
- import 'node:tty';
26
- import 'node:async_hooks';
27
- import '../shared/ccjk.Cjgrln_h.mjs';
28
- import 'node:util';
29
- import 'tty';
30
- import 'fs';
31
- import 'child_process';
32
- import 'node:path';
33
- import 'node:crypto';
34
- import 'buffer';
35
- import 'string_decoder';
36
- import 'node:url';
37
- import 'node:child_process';
38
- import './auto-updater.mjs';
39
- import '../shared/ccjk.DZ2LLOa-.mjs';
40
- import '../shared/ccjk.DeWpAShp.mjs';
41
- import './version-checker.mjs';
42
- import '../shared/ccjk.CxpGa6MC.mjs';
43
- import 'module';
44
- import 'node:stream';
45
- import './claude-config.mjs';
46
- import './json-config.mjs';
47
- import '../shared/ccjk.RyizuzOI.mjs';
48
- import 'node:fs/promises';
49
- import '../shared/ccjk.BLsIiTqO.mjs';
50
- import '../shared/ccjk.C94P8gCY.mjs';
51
- import './ccjk-config.mjs';
52
- import '../shared/ccjk.BBtCGd_g.mjs';
53
- import './index3.mjs';
54
- import '../shared/ccjk.BFQ7yr5S.mjs';
55
- import './prompts.mjs';
56
- import '../shared/ccjk.gDEDGD_t.mjs';
57
-
58
- const t = i18n.t.bind(i18n);
59
- function getClaudeSettings() {
60
- try {
61
- if (existsSync(SETTINGS_FILE)) {
62
- return JSON.parse(readFileSync(SETTINGS_FILE, "utf-8"));
63
- }
64
- } catch {
65
- }
66
- return null;
67
- }
68
- function saveClaudeSettings(settings) {
69
- try {
70
- if (!existsSync(CLAUDE_DIR)) {
71
- mkdirSync(CLAUDE_DIR, { recursive: true });
72
- }
73
- writeFileAtomic(SETTINGS_FILE, JSON.stringify(settings, null, 2));
74
- return true;
75
- } catch {
76
- return false;
77
- }
78
- }
79
- async function checkWorkingDirectory(cwd) {
80
- try {
81
- if (!existsSync(cwd)) {
82
- return {
83
- name: t("workspace:checks.cwdExists"),
84
- status: "fail",
85
- message: t("workspace:status.notExists"),
86
- details: cwd,
87
- fixDescription: t("workspace:fixes.createDirectory"),
88
- fix: async () => {
89
- try {
90
- mkdirSync(cwd, { recursive: true });
91
- return true;
92
- } catch {
93
- return false;
94
- }
95
- }
96
- };
97
- }
98
- const stat = statSync(cwd);
99
- if (!stat.isDirectory()) {
100
- return {
101
- name: t("workspace:checks.cwdExists"),
102
- status: "fail",
103
- message: t("workspace:status.notDirectory"),
104
- details: cwd
105
- };
106
- }
107
- return {
108
- name: t("workspace:checks.cwdExists"),
109
- status: "pass",
110
- message: cwd
111
- };
112
- } catch (error) {
113
- return {
114
- name: t("workspace:checks.cwdExists"),
115
- status: "fail",
116
- message: t("workspace:status.accessError"),
117
- details: error instanceof Error ? error.message : String(error)
118
- };
119
- }
120
- }
121
- async function checkWritePermission(cwd) {
122
- const testFile = join(cwd, `.ccjk-write-test-${Date.now()}.tmp`);
123
- try {
124
- writeFileSync(testFile, "test", { mode: 420 });
125
- const content = readFileSync(testFile, "utf-8");
126
- if (content !== "test") {
127
- throw new Error("Content mismatch");
128
- }
129
- const { unlinkSync } = await import('node:fs');
130
- unlinkSync(testFile);
131
- return {
132
- name: t("workspace:checks.writePermission"),
133
- status: "pass",
134
- message: t("workspace:status.writable")
135
- };
136
- } catch (error) {
137
- try {
138
- const { unlinkSync } = await import('node:fs');
139
- if (existsSync(testFile)) {
140
- unlinkSync(testFile);
141
- }
142
- } catch {
143
- }
144
- const isPermissionError = error instanceof Error && (error.message.includes("EACCES") || error.message.includes("EPERM"));
145
- if (isPermissionError) {
146
- return {
147
- name: t("workspace:checks.writePermission"),
148
- status: "fail",
149
- message: t("workspace:status.noWritePermission"),
150
- details: error instanceof Error ? error.message : String(error),
151
- fixDescription: t("workspace:fixes.fixPermission"),
152
- fix: async () => {
153
- try {
154
- if (platform() !== "win32") {
155
- await q("chmod", ["-R", "u+w", cwd], { throwOnError: true });
156
- return true;
157
- }
158
- return false;
159
- } catch {
160
- return false;
161
- }
162
- }
163
- };
164
- }
165
- return {
166
- name: t("workspace:checks.writePermission"),
167
- status: "fail",
168
- message: t("workspace:status.writeTestFailed"),
169
- details: error instanceof Error ? error.message : String(error)
170
- };
171
- }
172
- }
173
- async function checkDirectoryOwnership(cwd) {
174
- if (platform() === "win32") {
175
- return {
176
- name: t("workspace:checks.ownership"),
177
- status: "info",
178
- message: t("workspace:status.skippedWindows")
179
- };
180
- }
181
- try {
182
- const stat = statSync(cwd);
183
- const currentUid = process__default.getuid?.() ?? -1;
184
- if (currentUid === -1) {
185
- return {
186
- name: t("workspace:checks.ownership"),
187
- status: "info",
188
- message: t("workspace:status.cannotCheck")
189
- };
190
- }
191
- if (stat.uid !== currentUid) {
192
- const user = userInfo();
193
- return {
194
- name: t("workspace:checks.ownership"),
195
- status: "warn",
196
- message: t("workspace:status.differentOwner"),
197
- details: t("workspace:details.ownerMismatch", { currentUser: user.username, dirUid: stat.uid }),
198
- fixDescription: t("workspace:fixes.changeOwner"),
199
- fix: async () => {
200
- try {
201
- await q("sudo", ["chown", "-R", `${currentUid}:${process__default.getgid?.() ?? currentUid}`, cwd], { throwOnError: true });
202
- return true;
203
- } catch {
204
- return false;
205
- }
206
- }
207
- };
208
- }
209
- return {
210
- name: t("workspace:checks.ownership"),
211
- status: "pass",
212
- message: t("workspace:status.correctOwner")
213
- };
214
- } catch (error) {
215
- return {
216
- name: t("workspace:checks.ownership"),
217
- status: "info",
218
- message: t("workspace:status.checkFailed"),
219
- details: error instanceof Error ? error.message : String(error)
220
- };
221
- }
222
- }
223
- async function checkTrustedDirectories(cwd) {
224
- const settings = getClaudeSettings();
225
- if (!settings) {
226
- return {
227
- name: t("workspace:checks.trustedDirs"),
228
- status: "info",
229
- message: t("workspace:status.noSettings"),
230
- fixDescription: t("workspace:fixes.createSettings"),
231
- fix: async () => {
232
- return saveClaudeSettings({
233
- allowedDirectories: [cwd]
234
- });
235
- }
236
- };
237
- }
238
- const allowedDirs = settings.allowedDirectories || [];
239
- const isTrusted = allowedDirs.some((dir) => {
240
- const normalizedDir = resolve(dir);
241
- const normalizedCwd = resolve(cwd);
242
- return normalizedCwd === normalizedDir || normalizedCwd.startsWith(`${normalizedDir}/`);
243
- });
244
- if (!isTrusted) {
245
- return {
246
- name: t("workspace:checks.trustedDirs"),
247
- status: "warn",
248
- message: t("workspace:status.notTrusted"),
249
- details: t("workspace:details.trustedList", { dirs: allowedDirs.join(", ") || t("workspace:status.none") }),
250
- fixDescription: t("workspace:fixes.addToTrusted"),
251
- fix: async () => {
252
- const newSettings = { ...settings };
253
- const dirs = newSettings.allowedDirectories || [];
254
- dirs.push(cwd);
255
- newSettings.allowedDirectories = dirs;
256
- return saveClaudeSettings(newSettings);
257
- }
258
- };
259
- }
260
- return {
261
- name: t("workspace:checks.trustedDirs"),
262
- status: "pass",
263
- message: t("workspace:status.trusted")
264
- };
265
- }
266
- async function checkPathCharacters(cwd) {
267
- const problematicChars = /[<>:"|?*\x00-\x1F]/;
268
- const hasSpaces = cwd.includes(" ");
269
- const hasUnicode = /[^\x00-\x7F]/.test(cwd);
270
- if (problematicChars.test(cwd)) {
271
- return {
272
- name: t("workspace:checks.pathChars"),
273
- status: "fail",
274
- message: t("workspace:status.invalidChars"),
275
- details: t("workspace:details.avoidChars")
276
- };
277
- }
278
- if (hasSpaces || hasUnicode) {
279
- return {
280
- name: t("workspace:checks.pathChars"),
281
- status: "warn",
282
- message: hasSpaces ? t("workspace:status.hasSpaces") : t("workspace:status.hasUnicode"),
283
- details: t("workspace:details.mayHaveIssues")
284
- };
285
- }
286
- return {
287
- name: t("workspace:checks.pathChars"),
288
- status: "pass",
289
- message: t("workspace:status.pathOk")
290
- };
291
- }
292
- async function checkHomeDirectory(cwd) {
293
- const home = homedir();
294
- const normalizedCwd = resolve(cwd);
295
- const normalizedHome = resolve(home);
296
- const isInHome = normalizedCwd.startsWith(normalizedHome);
297
- if (!isInHome) {
298
- const systemDirs = ["/usr", "/bin", "/sbin", "/etc", "/var", "/tmp", "/root"];
299
- const isSystemDir = systemDirs.some((dir) => normalizedCwd.startsWith(dir));
300
- if (isSystemDir) {
301
- return {
302
- name: t("workspace:checks.homeDir"),
303
- status: "fail",
304
- message: t("workspace:status.systemDir"),
305
- details: t("workspace:details.dontUseSystemDir")
306
- };
307
- }
308
- return {
309
- name: t("workspace:checks.homeDir"),
310
- status: "warn",
311
- message: t("workspace:status.outsideHome"),
312
- details: t("workspace:details.recommendHome", { home })
313
- };
314
- }
315
- return {
316
- name: t("workspace:checks.homeDir"),
317
- status: "pass",
318
- message: t("workspace:status.insideHome")
319
- };
320
- }
321
- async function checkDiskSpace(cwd) {
322
- if (platform() === "win32") {
323
- return {
324
- name: t("workspace:checks.diskSpace"),
325
- status: "info",
326
- message: t("workspace:status.skippedWindows")
327
- };
328
- }
329
- try {
330
- const result = await q("df", ["-h", cwd], { throwOnError: false });
331
- const lines = result.stdout.trim().split("\n");
332
- if (lines.length >= 2) {
333
- const parts = lines[1].split(/\s+/);
334
- const available = parts[3];
335
- const usePercent = Number.parseInt(parts[4]);
336
- if (usePercent > 95) {
337
- return {
338
- name: t("workspace:checks.diskSpace"),
339
- status: "fail",
340
- message: t("workspace:status.diskFull", { percent: usePercent }),
341
- details: t("workspace:details.available", { space: available })
342
- };
343
- }
344
- if (usePercent > 90) {
345
- return {
346
- name: t("workspace:checks.diskSpace"),
347
- status: "warn",
348
- message: t("workspace:status.diskLow", { percent: usePercent }),
349
- details: t("workspace:details.available", { space: available })
350
- };
351
- }
352
- return {
353
- name: t("workspace:checks.diskSpace"),
354
- status: "pass",
355
- message: t("workspace:details.available", { space: available })
356
- };
357
- }
358
- return {
359
- name: t("workspace:checks.diskSpace"),
360
- status: "info",
361
- message: t("workspace:status.cannotCheck")
362
- };
363
- } catch {
364
- return {
365
- name: t("workspace:checks.diskSpace"),
366
- status: "info",
367
- message: t("workspace:status.checkFailed")
368
- };
369
- }
370
- }
371
- async function checkParentDirectory(cwd) {
372
- const parent = dirname(cwd);
373
- if (parent === cwd) {
374
- return {
375
- name: t("workspace:checks.parentDir"),
376
- status: "info",
377
- message: t("workspace:status.rootDir")
378
- };
379
- }
380
- try {
381
- const stat = statSync(parent);
382
- if (!stat.isDirectory()) {
383
- return {
384
- name: t("workspace:checks.parentDir"),
385
- status: "fail",
386
- message: t("workspace:status.parentNotDir")
387
- };
388
- }
389
- const { readdirSync } = await import('node:fs');
390
- readdirSync(parent);
391
- return {
392
- name: t("workspace:checks.parentDir"),
393
- status: "pass",
394
- message: t("workspace:status.parentOk")
395
- };
396
- } catch (error) {
397
- return {
398
- name: t("workspace:checks.parentDir"),
399
- status: "warn",
400
- message: t("workspace:status.parentAccessIssue"),
401
- details: error instanceof Error ? error.message : String(error)
402
- };
403
- }
404
- }
405
- async function checkEnvironment() {
406
- const isWSL = existsSync("/proc/version") && readFileSync("/proc/version", "utf-8").toLowerCase().includes("microsoft");
407
- const isDocker = existsSync("/.dockerenv") || existsSync("/proc/1/cgroup") && readFileSync("/proc/1/cgroup", "utf-8").includes("docker");
408
- if (isWSL) {
409
- return {
410
- name: t("workspace:checks.environment"),
411
- status: "info",
412
- message: t("workspace:status.wslDetected"),
413
- details: t("workspace:details.wslTips")
414
- };
415
- }
416
- if (isDocker) {
417
- return {
418
- name: t("workspace:checks.environment"),
419
- status: "info",
420
- message: t("workspace:status.dockerDetected"),
421
- details: t("workspace:details.dockerTips")
422
- };
423
- }
424
- return {
425
- name: t("workspace:checks.environment"),
426
- status: "pass",
427
- message: t("workspace:status.nativeEnv")
428
- };
429
- }
430
- async function runWorkspaceCheck(targetDir) {
431
- const cwd = targetDir ? resolve(targetDir) : process__default.cwd();
432
- const spinner = ora(t("workspace:checking")).start();
433
- const checks = [];
434
- spinner.text = t("workspace:checkingCwd");
435
- checks.push(await checkWorkingDirectory(cwd));
436
- spinner.text = t("workspace:checkingWrite");
437
- checks.push(await checkWritePermission(cwd));
438
- spinner.text = t("workspace:checkingOwnership");
439
- checks.push(await checkDirectoryOwnership(cwd));
440
- spinner.text = t("workspace:checkingTrusted");
441
- checks.push(await checkTrustedDirectories(cwd));
442
- spinner.text = t("workspace:checkingPath");
443
- checks.push(await checkPathCharacters(cwd));
444
- spinner.text = t("workspace:checkingHome");
445
- checks.push(await checkHomeDirectory(cwd));
446
- spinner.text = t("workspace:checkingDisk");
447
- checks.push(await checkDiskSpace(cwd));
448
- spinner.text = t("workspace:checkingParent");
449
- checks.push(await checkParentDirectory(cwd));
450
- spinner.text = t("workspace:checkingEnv");
451
- checks.push(await checkEnvironment());
452
- spinner.stop();
453
- const recommendations = [];
454
- const hasFailures = checks.some((c) => c.status === "fail");
455
- const hasWarnings = checks.some((c) => c.status === "warn");
456
- if (hasFailures) {
457
- recommendations.push(t("workspace:recommendations.fixFailures"));
458
- }
459
- if (hasWarnings) {
460
- recommendations.push(t("workspace:recommendations.reviewWarnings"));
461
- }
462
- const trustedCheck = checks.find((c) => c.name === t("workspace:checks.trustedDirs"));
463
- if (trustedCheck && trustedCheck.status !== "pass") {
464
- recommendations.push(t("workspace:recommendations.trustDir", { cmd: `claude config add trustedDirectories "${cwd}"` }));
465
- }
466
- return {
467
- cwd,
468
- isValid: !hasFailures,
469
- checks,
470
- recommendations
471
- };
472
- }
473
- function displayWorkspaceReport(report) {
474
- console.log(a.green(`
475
- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 ${t("workspace:title")} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
476
- `));
477
- console.log(a.white.bold(`${t("workspace:currentDir")}: ${a.yellow(report.cwd)}
478
- `));
479
- for (const check of report.checks) {
480
- let icon;
481
- let color;
482
- switch (check.status) {
483
- case "pass":
484
- icon = "\u2705";
485
- color = a.green;
486
- break;
487
- case "warn":
488
- icon = "\u26A0\uFE0F";
489
- color = a.yellow;
490
- break;
491
- case "fail":
492
- icon = "\u274C";
493
- color = a.red;
494
- break;
495
- case "info":
496
- default:
497
- icon = "\u2139\uFE0F";
498
- color = a.gray;
499
- break;
500
- }
501
- console.log(`${icon} ${a.bold(check.name.padEnd(20))} ${color(check.message)}`);
502
- if (check.details) {
503
- console.log(a.gray(` ${check.details}`));
504
- }
505
- if (check.fixDescription && (check.status === "fail" || check.status === "warn")) {
506
- console.log(a.dim(` \u{1F4A1} ${check.fixDescription}`));
507
- }
508
- }
509
- console.log("");
510
- console.log(a.dim("\u2500".repeat(50)));
511
- if (report.isValid) {
512
- console.log(STATUS.success(t("workspace:summary.valid")));
513
- } else {
514
- console.log(STATUS.error(t("workspace:summary.invalid")));
515
- }
516
- if (report.recommendations.length > 0) {
517
- console.log(a.yellow(`
518
- ${t("workspace:recommendations.title")}:`));
519
- for (const rec of report.recommendations) {
520
- console.log(a.yellow(` \u2022 ${rec}`));
521
- }
522
- }
523
- console.log("");
524
- }
525
- async function runWorkspaceWizard(targetDir) {
526
- const report = await runWorkspaceCheck(targetDir);
527
- displayWorkspaceReport(report);
528
- const fixableChecks = report.checks.filter(
529
- (c) => c.fix && (c.status === "fail" || c.status === "warn")
530
- );
531
- if (fixableChecks.length === 0) {
532
- if (report.isValid) {
533
- console.log(STATUS.success(t("workspace:wizard.allGood")));
534
- } else {
535
- console.log(STATUS.warning(t("workspace:wizard.manualFix")));
536
- }
537
- return;
538
- }
539
- console.log("");
540
- console.log(a.green(t("workspace:wizard.autoFixing", { count: fixableChecks.length })));
541
- for (const check of fixableChecks) {
542
- const spinner = ora(`${t("workspace:wizard.fixing")} ${check.name}...`).start();
543
- try {
544
- const success = await check.fix();
545
- if (success) {
546
- spinner.succeed(`${check.name} ${t("workspace:wizard.fixed")}`);
547
- } else {
548
- spinner.fail(`${check.name} ${t("workspace:wizard.fixFailed")}`);
549
- }
550
- } catch (error) {
551
- spinner.fail(`${check.name}: ${error instanceof Error ? error.message : String(error)}`);
552
- }
553
- }
554
- console.log("");
555
- console.log(a.green(t("workspace:wizard.verifying")));
556
- const newReport = await runWorkspaceCheck(targetDir);
557
- if (newReport.isValid) {
558
- console.log(STATUS.success(t("workspace:wizard.allFixed")));
559
- } else {
560
- console.log(STATUS.warning(t("workspace:wizard.someRemain")));
561
- displayWorkspaceReport(newReport);
562
- }
563
- }
564
-
565
- async function checkClaudeCode(codeType) {
566
- const target = resolveClaudeFamilySettingsTarget(codeType);
567
- const runtimeCommand = getCodeToolRuntimeCommand(target.codeTool);
568
- const hasCommand = await commandExists(runtimeCommand);
569
- if (hasCommand) {
570
- return { name: target.displayName, status: "ok", message: "Installed" };
571
- }
572
- return {
573
- name: target.displayName,
574
- status: "error",
575
- message: "Not installed",
576
- fix: target.codeTool === "clavue" ? "Run: npm install -g clavue" : "Run: npm install -g @anthropic-ai/claude-code"
577
- };
578
- }
579
- async function checkClaudeDir(codeType) {
580
- const target = resolveClaudeFamilySettingsTarget(codeType);
581
- if (existsSync(target.configDir)) {
582
- return { name: "Config Directory", status: "ok", message: target.configDir };
583
- }
584
- return {
585
- name: "Config Directory",
586
- status: "error",
587
- message: "Does not exist",
588
- fix: "Run: npx ccjk init"
589
- };
590
- }
591
- async function checkSettings(codeType) {
592
- const target = resolveClaudeFamilySettingsTarget(codeType);
593
- if (!existsSync(target.settingsFile)) {
594
- return {
595
- name: "settings.json",
596
- status: "warning",
597
- message: "Not found",
598
- fix: "Run: npx ccjk init"
599
- };
600
- }
601
- try {
602
- const { readFileSync } = await import('node:fs');
603
- const content = readFileSync(target.settingsFile, "utf-8");
604
- const settings = JSON.parse(content);
605
- const issues = [];
606
- if (settings.$schema && settings.$schema !== "https://json.schemastore.org/claude-code-settings.json") {
607
- issues.push("Invalid $schema URL");
608
- }
609
- if (typeof settings.attribution === "string") {
610
- issues.push("attribution should be an object, not a string");
611
- }
612
- if (settings.fileSuggestion && settings.fileSuggestion.type !== "command") {
613
- issues.push('fileSuggestion.type must be "command"');
614
- }
615
- if (settings.permissions?.allow) {
616
- const lowerCaseTools = settings.permissions.allow.filter(
617
- (t) => /^[a-z]/.test(t) && !t.startsWith("Allow") && !t.startsWith("mcp__")
618
- );
619
- if (lowerCaseTools.length > 0) {
620
- issues.push(`${lowerCaseTools.length} permission(s) with lowercase names`);
621
- }
622
- }
623
- if (settings.plansDirectory === null) {
624
- issues.push("plansDirectory should not be null");
625
- }
626
- const env = settings.env || {};
627
- const hasAnthropicModelVars = Boolean(
628
- env.ANTHROPIC_MODEL || env.ANTHROPIC_DEFAULT_OPUS_MODEL || env.ANTHROPIC_DEFAULT_SONNET_MODEL || env.ANTHROPIC_DEFAULT_HAIKU_MODEL
629
- );
630
- if (settings.model && hasAnthropicModelVars) {
631
- issues.push(`settings.model="${settings.model}" overrides ANTHROPIC_* env vars (custom model selection broken)`);
632
- }
633
- const sonnet = env.ANTHROPIC_DEFAULT_SONNET_MODEL;
634
- if (typeof sonnet === "string" && /opus/i.test(sonnet)) {
635
- issues.push(`ANTHROPIC_DEFAULT_SONNET_MODEL="${sonnet}" looks like an Opus model (slot misrouted)`);
636
- }
637
- const preToolUse = settings.hooks?.PreToolUse;
638
- if (Array.isArray(preToolUse)) {
639
- const hasGatekeeper = preToolUse.some(
640
- (h) => h?.matcher === "mcp__.*" && Array.isArray(h?.hooks) && h.hooks.some((c) => typeof c?.command === "string" && c.command.includes("mcp-gatekeeper"))
641
- );
642
- if (hasGatekeeper) {
643
- issues.push("mcp-gatekeeper PreToolUse hook is enabled (forks bash+node per MCP call; disabled by default)");
644
- }
645
- }
646
- if (issues.length > 0) {
647
- return {
648
- name: "settings.json",
649
- status: "error",
650
- message: `Validation issues: ${issues.length} problem(s)`,
651
- fix: "Run: npx ccjk doctor --fix-settings",
652
- details: issues
653
- };
654
- }
655
- return { name: "settings.json", status: "ok", message: "Valid configuration" };
656
- } catch (_error) {
657
- return {
658
- name: "settings.json",
659
- status: "error",
660
- message: "Invalid JSON",
661
- fix: "Run: npx ccjk init"
662
- };
663
- }
664
- }
665
- async function checkWorkflows(codeType) {
666
- const target = resolveClaudeFamilySettingsTarget(codeType);
667
- const commandsDir = join(target.configDir, "commands", "ccjk");
668
- if (existsSync(commandsDir)) {
669
- try {
670
- const files = readdirSync(commandsDir, { recursive: true });
671
- const mdFiles = files.filter((f) => String(f).endsWith(".md"));
672
- if (mdFiles.length === 0) {
673
- return {
674
- name: "Workflows",
675
- status: "warning",
676
- message: "No CCJK commands installed",
677
- fix: `Run: npx ccjk zero-config dev${target.codeTool === "clavue" ? " --code-type clavue" : ""}`
678
- };
679
- }
680
- return {
681
- name: "Workflows",
682
- status: "ok",
683
- message: `${mdFiles.length} commands installed`
684
- };
685
- } catch {
686
- return { name: "Workflows", status: "warning", message: "Cannot read directory" };
687
- }
688
- }
689
- return {
690
- name: "Workflows",
691
- status: "warning",
692
- message: "Not installed",
693
- fix: "Run: npx ccjk update"
694
- };
695
- }
696
- async function checkMcp(codeType) {
697
- const target = resolveClaudeFamilySettingsTarget(codeType);
698
- try {
699
- const state = await inspectClaudeFamilyCoreFeatures(target.codeTool);
700
- if (state.mcp.installed.length > 0) {
701
- const result = {
702
- name: "MCP Services",
703
- status: state.mcp.missing.length === 0 ? "ok" : "warning",
704
- message: `${state.mcp.installed.length} service(s) configured`
705
- };
706
- if (state.mcp.missing.length > 0) {
707
- result.fix = `Run: npx ccjk zero-config dev${target.codeTool === "clavue" ? " --code-type clavue" : ""}`;
708
- result.details = [`Missing core service(s): ${state.mcp.missing.join(", ")}`];
709
- }
710
- return result;
711
- }
712
- } catch {
713
- }
714
- return {
715
- name: "MCP Services",
716
- status: "warning",
717
- message: "Not configured",
718
- fix: `Run: npx ccjk zero-config dev${target.codeTool === "clavue" ? " --code-type clavue" : ""}`
719
- };
720
- }
721
- async function checkCcr() {
722
- const status = await isCcrInstalled();
723
- if (status.hasCorrectPackage) {
724
- return { name: "CCR Proxy", status: "ok", message: "Installed" };
725
- }
726
- if (status.isInstalled) {
727
- return {
728
- name: "CCR Proxy",
729
- status: "warning",
730
- message: "Command exists, managed package not detected",
731
- fix: "Run: npx ccjk zero-config dev"
732
- };
733
- }
734
- return {
735
- name: "CCR Proxy",
736
- status: "warning",
737
- message: "Not installed",
738
- fix: "Run: npx ccjk zero-config dev"
739
- };
740
- }
741
- async function checkDisciplineBaseline(codeType) {
742
- const target = resolveClaudeFamilySettingsTarget(codeType);
743
- const memoryFile = target.instructionsFile;
744
- if (!existsSync(memoryFile)) {
745
- return {
746
- name: "Discipline Baseline",
747
- status: "warning",
748
- message: "No memory file found",
749
- fix: "Run: npx ccjk init"
750
- };
751
- }
752
- const { readFileSync } = await import('node:fs');
753
- const text = readFileSync(memoryFile, "utf-8");
754
- const required = [
755
- "# Coding Discipline Baseline",
756
- "Think before coding",
757
- "Simplicity first",
758
- "Surgical changes",
759
- "Goal-driven execution"
760
- ];
761
- const missing = required.filter((m) => !text.includes(m));
762
- if (missing.length === 0) {
763
- return {
764
- name: "Discipline Baseline",
765
- status: "ok",
766
- message: "All 4 principles present"
767
- };
768
- }
769
- if (missing.length === required.length) {
770
- return {
771
- name: "Discipline Baseline",
772
- status: "warning",
773
- message: "Baseline not installed (memory file exists but has no discipline section)",
774
- fix: "Run: npx ccjk init"
775
- };
776
- }
777
- return {
778
- name: "Discipline Baseline",
779
- status: "error",
780
- message: `Baseline partially missing: ${missing.length}/${required.length} markers absent`,
781
- fix: "Run: npx ccjk init (will rewrite CLAUDE.md with full baseline)",
782
- details: missing
783
- };
784
- }
785
- async function checkOutputStyles(codeType) {
786
- const target = resolveClaudeFamilySettingsTarget(codeType);
787
- const stylesDir = join(target.configDir, "output-styles");
788
- if (existsSync(stylesDir)) {
789
- try {
790
- const files = readdirSync(stylesDir).filter((f) => f.endsWith(".md"));
791
- if (files.length === 0) {
792
- return {
793
- name: "Output Styles",
794
- status: "warning",
795
- message: "No styles installed",
796
- fix: `Run: npx ccjk zero-config dev${target.codeTool === "clavue" ? " --code-type clavue" : ""}`
797
- };
798
- }
799
- return {
800
- name: "Output Styles",
801
- status: "ok",
802
- message: `${files.length} styles available`
803
- };
804
- } catch {
805
- return { name: "Output Styles", status: "warning", message: "Cannot read directory" };
806
- }
807
- }
808
- return {
809
- name: "Output Styles",
810
- status: "warning",
811
- message: "Not installed",
812
- fix: `Run: npx ccjk zero-config dev${target.codeTool === "clavue" ? " --code-type clavue" : ""}`
813
- };
814
- }
815
- async function checkCodexCli() {
816
- const hasCommand = await commandExists("codex");
817
- if (hasCommand) {
818
- return { name: "Codex", status: "ok", message: "Installed" };
819
- }
820
- return {
821
- name: "Codex",
822
- status: "error",
823
- message: "Not installed",
824
- fix: "Run: npm install -g @openai/codex"
825
- };
826
- }
827
- async function checkCodexDir() {
828
- if (existsSync(CODEX_DIR)) {
829
- return { name: "Config Directory", status: "ok", message: CODEX_DIR };
830
- }
831
- return {
832
- name: "Config Directory",
833
- status: "error",
834
- message: "Does not exist",
835
- fix: "Run: npx ccjk init --code-type codex"
836
- };
837
- }
838
- async function checkCodexToml() {
839
- if (!existsSync(CODEX_CONFIG_FILE)) {
840
- return {
841
- name: "config.toml",
842
- status: "warning",
843
- message: "Not found",
844
- fix: "Run: ccjk zero-config dev --code-type codex"
845
- };
846
- }
847
- const config = readCodexConfig();
848
- if (!config) {
849
- return {
850
- name: "config.toml",
851
- status: "error",
852
- message: "Invalid TOML",
853
- fix: "Check ~/.codex/config.toml or run: ccjk zero-config dev --code-type codex"
854
- };
855
- }
856
- return {
857
- name: "config.toml",
858
- status: "ok",
859
- message: "Valid configuration"
860
- };
861
- }
862
- async function checkCodexFieldValues() {
863
- if (!existsSync(CODEX_CONFIG_FILE)) {
864
- return { name: "Codex Field Values", status: "ok", message: "Skipped (no config)" };
865
- }
866
- const { readFileSync } = await import('node:fs');
867
- const text = readFileSync(CODEX_CONFIG_FILE, "utf-8");
868
- const issues = [];
869
- const validEffort = /* @__PURE__ */ new Set(["minimal", "low", "medium", "high"]);
870
- const validTier = /* @__PURE__ */ new Set(["default", "flex", "priority"]);
871
- const effortMatch = text.match(/^model_reasoning_effort\s*=\s*"([^"]+)"/m);
872
- if (effortMatch && !validEffort.has(effortMatch[1])) {
873
- issues.push(`model_reasoning_effort="${effortMatch[1]}" (valid: ${[...validEffort].join("/")})`);
874
- }
875
- const tierMatch = text.match(/^service_tier\s*=\s*"([^"]+)"/m);
876
- if (tierMatch && !validTier.has(tierMatch[1])) {
877
- issues.push(`service_tier="${tierMatch[1]}" (valid: ${[...validTier].join("/")})`);
878
- }
879
- if (issues.length === 0) {
880
- return { name: "Codex Field Values", status: "ok", message: "All fields valid" };
881
- }
882
- return {
883
- name: "Codex Field Values",
884
- status: "warning",
885
- message: `${issues.length} non-standard value(s) \u2014 Codex silently uses defaults`,
886
- fix: "Edit ~/.codex/config.toml",
887
- details: issues
888
- };
889
- }
890
- async function checkCodexTrustedProjects() {
891
- if (!existsSync(CODEX_CONFIG_FILE)) {
892
- return { name: "Codex Trusted Projects", status: "ok", message: "Skipped (no config)" };
893
- }
894
- const { readFileSync } = await import('node:fs');
895
- const text = readFileSync(CODEX_CONFIG_FILE, "utf-8");
896
- const trusted = [];
897
- const re = /\[projects\."([^"]+)"\]/g;
898
- let m;
899
- while ((m = re.exec(text)) !== null) {
900
- trusted.push(m[1]);
901
- }
902
- const stale = trusted.filter((p) => !existsSync(p));
903
- if (stale.length === 0) {
904
- return {
905
- name: "Codex Trusted Projects",
906
- status: "ok",
907
- message: `${trusted.length} entries, all paths exist`
908
- };
909
- }
910
- return {
911
- name: "Codex Trusted Projects",
912
- status: "warning",
913
- message: `${stale.length} of ${trusted.length} trusted paths no longer exist on disk`,
914
- fix: "Edit ~/.codex/config.toml to remove dead entries",
915
- details: stale.slice(0, 10)
916
- };
917
- }
918
- async function checkCodexMcp() {
919
- const config = readCodexConfig();
920
- const count = config?.mcpServices.length || 0;
921
- if (count > 0) {
922
- return {
923
- name: "MCP Services",
924
- status: "ok",
925
- message: `${count} service(s) configured`
926
- };
927
- }
928
- return {
929
- name: "MCP Services",
930
- status: "warning",
931
- message: "Not configured",
932
- fix: "Run: npx ccjk mcp profile use recommended --tool codex"
933
- };
934
- }
935
- async function checkCodexNativeGoals() {
936
- const enabled = readCodexGoalsFeatureEnabled();
937
- if (enabled) {
938
- return {
939
- name: "Native Goals",
940
- status: "ok",
941
- message: "Codex /goal enabled"
942
- };
943
- }
944
- return {
945
- name: "Native Goals",
946
- status: "warning",
947
- message: "Codex /goal not enabled",
948
- fix: "Run: ccjk zero-config dev --code-type codex"
949
- };
950
- }
951
- async function checkClavueNativeGoals() {
952
- const hasCommand = await commandExists("clavue");
953
- if (hasCommand) {
954
- return {
955
- name: "Native Goals",
956
- status: "ok",
957
- message: "Clavue /goal available"
958
- };
959
- }
960
- return {
961
- name: "Native Goals",
962
- status: "error",
963
- message: "Clavue /goal unavailable",
964
- fix: "Run: npm install -g clavue"
965
- };
966
- }
967
- async function checkCcjkProfiles() {
968
- const { homedir } = await import('node:os');
969
- const ccjkConfigPath = join(homedir(), ".ccjk", "config.toml");
970
- if (!existsSync(ccjkConfigPath)) {
971
- return { name: "CCJK Profiles", status: "ok", message: "Skipped (no config)" };
972
- }
973
- const { readFileSync } = await import('node:fs');
974
- const text = readFileSync(ccjkConfigPath, "utf-8");
975
- const suspicious = [];
976
- const sectionRe = /^\[claudeCode\.profiles\.([^\]]+)\]$([\s\S]*?)(?=^\[|\z)/gm;
977
- let m;
978
- while ((m = sectionRe.exec(text)) !== null) {
979
- const name = m[1];
980
- const body = m[2];
981
- const apiKey = body.match(/apiKey\s*=\s*"([^"]*)"/)?.[1] ?? "";
982
- const baseUrl = body.match(/baseUrl\s*=\s*"([^"]*)"/)?.[1] ?? "";
983
- const reasons = [];
984
- if (/^\d+$/.test(name)) {
985
- reasons.push("numeric-only name");
986
- }
987
- if (apiKey && apiKey.length < 10) {
988
- reasons.push(`apiKey too short (${apiKey.length} chars)`);
989
- }
990
- if (baseUrl && !/^https?:\/\/[^\s/]+\.[^\s/]/.test(baseUrl)) {
991
- reasons.push(`baseUrl looks invalid: ${baseUrl}`);
992
- }
993
- if (apiKey.startsWith("sk-ant-test-") || /test-?\d+/i.test(apiKey)) {
994
- reasons.push("apiKey looks like a test placeholder");
995
- }
996
- if (reasons.length > 0) {
997
- suspicious.push(`${name}: ${reasons.join("; ")}`);
998
- }
999
- }
1000
- if (suspicious.length === 0) {
1001
- return { name: "CCJK Profiles", status: "ok", message: "No junk profiles detected" };
1002
- }
1003
- return {
1004
- name: "CCJK Profiles",
1005
- status: "warning",
1006
- message: `${suspicious.length} suspicious profile(s) in ~/.ccjk/config.toml`,
1007
- fix: "Use ccjk menu to remove or rename them",
1008
- details: suspicious
1009
- };
1010
- }
1011
- async function checkCodexProviders() {
1012
- const config = readCodexConfig();
1013
- if (!config) {
1014
- return {
1015
- name: "API Providers",
1016
- status: "warning",
1017
- message: "Unable to read Codex config"
1018
- };
1019
- }
1020
- if (config.modelProvider) {
1021
- return {
1022
- name: "API Providers",
1023
- status: "ok",
1024
- message: `Using ${config.modelProvider}`
1025
- };
1026
- }
1027
- return {
1028
- name: "API Providers",
1029
- status: "ok",
1030
- message: "Using official Codex login"
1031
- };
1032
- }
1033
- async function checkProviders(codeType = "claude-code") {
1034
- try {
1035
- const providers = await getApiProviderPresets(codeType);
1036
- if (providers.length === 0) {
1037
- return {
1038
- name: "API Providers",
1039
- status: "warning",
1040
- message: "No providers available"
1041
- };
1042
- }
1043
- const monitor = new ProviderHealthMonitor({
1044
- timeout: 3e3,
1045
- degradedLatencyThreshold: 1e3,
1046
- unhealthyLatencyThreshold: 3e3
1047
- });
1048
- monitor.setProviders(providers);
1049
- const results = await Promise.race([
1050
- Promise.all(
1051
- providers.map(async (provider) => {
1052
- const result = await monitor.checkHealth(provider);
1053
- return { provider, result };
1054
- })
1055
- ),
1056
- new Promise((resolve2) => {
1057
- setTimeout(() => resolve2(null), 5e3);
1058
- })
1059
- ]);
1060
- if (!results) {
1061
- return {
1062
- name: "API Providers",
1063
- status: "warning",
1064
- message: "Health check timeout"
1065
- };
1066
- }
1067
- const healthyCount = results.filter((r) => r.result.success).length;
1068
- if (healthyCount === 0) {
1069
- return {
1070
- name: "API Providers",
1071
- status: "error",
1072
- message: "All providers unavailable",
1073
- fix: "Check your network connection"
1074
- };
1075
- }
1076
- if (healthyCount < providers.length) {
1077
- return {
1078
- name: "API Providers",
1079
- status: "warning",
1080
- message: `${healthyCount}/${providers.length} providers healthy`
1081
- };
1082
- }
1083
- return {
1084
- name: "API Providers",
1085
- status: "ok",
1086
- message: `${healthyCount} providers healthy`
1087
- };
1088
- } catch {
1089
- return {
1090
- name: "API Providers",
1091
- status: "warning",
1092
- message: "Health check failed"
1093
- };
1094
- }
1095
- }
1096
- async function checkPermissionRules(codeType) {
1097
- const isZh = i18n.language === "zh-CN";
1098
- try {
1099
- const target = resolveClaudeFamilySettingsTarget(codeType);
1100
- const permissionManager = getPermissionManager(void 0, target.settingsFile);
1101
- const unreachableRules = permissionManager.getUnreachableRules();
1102
- const allDiagnostics = permissionManager.getAllDiagnostics();
1103
- const conflictedRules = allDiagnostics.filter((d) => d.conflicts.length > 0);
1104
- const problemCount = unreachableRules.length + conflictedRules.length;
1105
- if (problemCount === 0) {
1106
- const stats = permissionManager.getStats();
1107
- return {
1108
- name: "Permission Rules",
1109
- status: "ok",
1110
- message: `${stats.total} rules configured`
1111
- };
1112
- }
1113
- const details = [];
1114
- if (unreachableRules.length > 0) {
1115
- details.push(isZh ? `${unreachableRules.length} unreachable rule(s)` : `${unreachableRules.length} unreachable rule(s)`);
1116
- for (const rule of unreachableRules.slice(0, 3)) {
1117
- details.push(` - ${a.dim(rule.pattern)}`);
1118
- }
1119
- if (unreachableRules.length > 3) {
1120
- details.push(` ... ${isZh ? "and" : "and"} ${unreachableRules.length - 3} ${isZh ? "more" : "more"}`);
1121
- }
1122
- }
1123
- if (conflictedRules.length > 0) {
1124
- details.push(isZh ? `${conflictedRules.length} conflicted rule(s)` : `${conflictedRules.length} conflicted rule(s)`);
1125
- }
1126
- return {
1127
- name: "Permission Rules",
1128
- status: "warning",
1129
- message: `${problemCount} ${isZh ? "problematic" : "problematic"} ${isZh ? "rule(s)" : "rule(s)"}`,
1130
- fix: isZh ? "Run: ccjk zero-config dev" : "Run: ccjk zero-config dev",
1131
- details
1132
- };
1133
- } catch {
1134
- return {
1135
- name: "Permission Rules",
1136
- status: "warning",
1137
- message: "Unable to check"
1138
- };
1139
- }
1140
- }
1141
- async function fixSettingsFile(codeType) {
1142
- const isZh = i18n.language === "zh-CN";
1143
- const target = resolveClaudeFamilySettingsTarget(codeType);
1144
- console.log("");
1145
- console.log(a.bold.cyan("\u{1F527} Fixing settings.json"));
1146
- console.log(a.dim("\u2500".repeat(50)));
1147
- console.log("");
1148
- const backupPath = backupExistingConfig(target.codeTool);
1149
- try {
1150
- if (existsSync(target.settingsFile) && backupPath) {
1151
- console.log(a.green(`\u2714 ${isZh ? "\u5DF2\u5907\u4EFD\u65E7\u8BBE\u7F6E" : "Backed up settings"}: ${backupPath}`));
1152
- }
1153
- } catch (_error) {
1154
- console.log(a.yellow(`\u26A0\uFE0F ${isZh ? "\u5907\u4EFD\u5931\u8D25\uFF0C\u7EE7\u7EED..." : "Backup failed, continuing..."}`));
1155
- }
1156
- console.log("");
1157
- console.log(a.dim(isZh ? "\u6B63\u5728\u5408\u5E76\u6A21\u677F\u8BBE\u7F6E..." : "Merging template settings..."));
1158
- copyConfigFiles(false, target.codeTool);
1159
- const checkResult = await checkSettings(target.codeTool);
1160
- console.log("");
1161
- if (checkResult.status === "ok") {
1162
- console.log(a.green(`\u2705 ${isZh ? "\u8BBE\u7F6E\u5DF2\u4FEE\u590D\uFF01" : "Settings fixed successfully!"}`));
1163
- } else {
1164
- console.log(a.yellow(`\u26A0\uFE0F ${isZh ? "\u4ECD\u6709\u4E00\u4E9B\u95EE\u9898" : "Some issues remain"}:`));
1165
- if (checkResult.details) {
1166
- for (const detail of checkResult.details) {
1167
- console.log(a.dim(` \u2022 ${detail}`));
1168
- }
1169
- }
1170
- }
1171
- console.log("");
1172
- console.log(a.dim(isZh ? "\u63D0\u793A: \u8BF7\u91CD\u542F Claude Code \u4EE5\u5E94\u7528\u66F4\u6539" : "Tip: Restart Claude Code to apply changes"));
1173
- console.log("");
1174
- }
1175
- async function doctor(options = {}) {
1176
- const isZh = i18n.language === "zh-CN";
1177
- if (options.fixSettings) {
1178
- await fixSettingsFile(options.codeType);
1179
- return;
1180
- }
1181
- const checks = options.codeType === "codex" ? [
1182
- checkCodexCli,
1183
- checkCodexDir,
1184
- checkCodexToml,
1185
- checkCodexFieldValues,
1186
- checkCodexTrustedProjects,
1187
- checkCodexMcp,
1188
- checkCodexNativeGoals,
1189
- checkCcjkProfiles
1190
- ] : [
1191
- () => checkClaudeCode(options.codeType),
1192
- () => checkClaudeDir(options.codeType),
1193
- () => checkSettings(options.codeType),
1194
- () => checkDisciplineBaseline(options.codeType),
1195
- () => checkWorkflows(options.codeType),
1196
- () => checkMcp(options.codeType),
1197
- () => checkPermissionRules(options.codeType),
1198
- checkCcr,
1199
- () => checkOutputStyles(options.codeType),
1200
- ...options.codeType === "clavue" ? [checkClavueNativeGoals] : [],
1201
- checkCcjkProfiles
1202
- ];
1203
- if (options.checkProviders) {
1204
- checks.push(options.codeType === "codex" ? checkCodexProviders : () => checkProviders(options.codeType));
1205
- }
1206
- const results = [];
1207
- for (const check of checks) {
1208
- const result = await check();
1209
- results.push(result);
1210
- }
1211
- if (options.json) {
1212
- const output = {
1213
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1214
- summary: {
1215
- total: results.length,
1216
- ok: results.filter((r) => r.status === "ok").length,
1217
- warning: results.filter((r) => r.status === "warning").length,
1218
- error: results.filter((r) => r.status === "error").length
1219
- },
1220
- checks: results.map((r) => ({
1221
- name: r.name,
1222
- status: r.status,
1223
- message: r.message,
1224
- fix: r.fix,
1225
- details: r.details
1226
- }))
1227
- };
1228
- console.log(JSON.stringify(output, null, 2));
1229
- return;
1230
- }
1231
- console.log("");
1232
- console.log(a.bold.cyan("\u{1F50D} CCJK Health Check"));
1233
- console.log(a.dim("\u2500".repeat(50)));
1234
- console.log("");
1235
- let hasErrors = false;
1236
- let hasWarnings = false;
1237
- for (const result of results) {
1238
- const statusIcon = result.status === "ok" ? a.green("\u2705") : result.status === "warning" ? a.yellow("\u26A0\uFE0F") : a.red("\u274C");
1239
- const statusColor = result.status === "ok" ? a.green : result.status === "warning" ? a.yellow : a.red;
1240
- console.log(`${statusIcon} ${a.bold(result.name)}: ${statusColor(result.message)}`);
1241
- if (result.fix) {
1242
- console.log(a.dim(` \u{1F4A1} Fix: ${result.fix}`));
1243
- }
1244
- if (result.details && result.details.length > 0) {
1245
- for (const detail of result.details) {
1246
- console.log(a.dim(` ${detail}`));
1247
- }
1248
- }
1249
- if (result.status === "error")
1250
- hasErrors = true;
1251
- if (result.status === "warning")
1252
- hasWarnings = true;
1253
- }
1254
- console.log("");
1255
- console.log(a.dim("\u2500".repeat(50)));
1256
- if (hasErrors) {
1257
- console.log(a.red("\u274C Issues found - please follow the suggestions above"));
1258
- } else if (hasWarnings) {
1259
- console.log(a.yellow("\u26A0\uFE0F Configuration is functional, but some features may be limited"));
1260
- } else {
1261
- console.log(a.green("\u2705 All checks passed - CCJK is properly configured!"));
1262
- }
1263
- console.log("");
1264
- if (!options.checkProviders) {
1265
- const { checkProvidersNow } = await inquirer.prompt({
1266
- type: "confirm",
1267
- name: "checkProvidersNow",
1268
- message: isZh ? "\u662F\u5426\u68C0\u67E5 API \u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001\uFF1F" : "Check API provider health status?",
1269
- default: false
1270
- });
1271
- if (checkProvidersNow) {
1272
- console.log("");
1273
- console.log(a.dim(isZh ? "\u6B63\u5728\u68C0\u67E5\u4F9B\u5E94\u5546..." : "Checking providers..."));
1274
- const providerResult = await checkProviders(options.codeType);
1275
- const statusIcon = providerResult.status === "ok" ? a.green("\u2705") : providerResult.status === "warning" ? a.yellow("\u26A0\uFE0F") : a.red("\u274C");
1276
- const statusColor = providerResult.status === "ok" ? a.green : providerResult.status === "warning" ? a.yellow : a.red;
1277
- console.log(`${statusIcon} ${a.bold(providerResult.name)}: ${statusColor(providerResult.message)}`);
1278
- if (providerResult.fix) {
1279
- console.log(a.dim(` \u{1F4A1} Fix: ${providerResult.fix}`));
1280
- }
1281
- console.log("");
1282
- }
1283
- }
1284
- const { runWorkspace } = await inquirer.prompt({
1285
- type: "confirm",
1286
- name: "runWorkspace",
1287
- message: isZh ? "\u662F\u5426\u68C0\u67E5\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\u7684\u6587\u4EF6\u5199\u5165\u6743\u9650\uFF1F" : "Check file write permissions for current directory?",
1288
- default: false
1289
- });
1290
- if (runWorkspace) {
1291
- console.log("");
1292
- const report = await runWorkspaceCheck(process__default.cwd());
1293
- displayWorkspaceReport(report);
1294
- }
1295
- }
1296
- async function workspaceDiagnostics(targetDir) {
1297
- const dir = targetDir ? resolve(targetDir) : process__default.cwd();
1298
- await runWorkspaceWizard(dir);
1299
- }
1300
-
1301
- export { doctor, workspaceDiagnostics };