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,481 +0,0 @@
1
- import { existsSync, statSync } from 'node:fs';
2
- import { homedir } from 'node:os';
3
- import process__default from 'node:process';
4
- import a from './index5.mjs';
5
- import { i18n } from './index2.mjs';
6
- import { createHash } from 'node:crypto';
7
- import { exec as q } from './main.mjs';
8
- import { n as normalize, j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
9
- import '../shared/ccjk.BAGoDD49.mjs';
10
- import 'node:url';
11
- import 'module';
12
- import 'node:child_process';
13
- import 'node:path';
14
- import 'node:stream';
15
- import 'node:readline';
16
-
17
- async function generateProjectHash(projectPath) {
18
- let normalizedPath = normalize(projectPath);
19
- normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
20
- const gitInfo = await getGitInfo(normalizedPath);
21
- const hashInput = [
22
- normalizedPath,
23
- gitInfo.remote || "",
24
- gitInfo.branch || ""
25
- ].join("|");
26
- const hash = createHash("sha256").update(hashInput).digest("hex").substring(0, 16);
27
- return {
28
- path: normalizedPath,
29
- gitRemote: gitInfo.remote,
30
- gitBranch: gitInfo.branch,
31
- hash
32
- };
33
- }
34
- async function getGitInfo(projectPath) {
35
- try {
36
- const gitDir = join(projectPath, ".git");
37
- if (!existsSync(gitDir)) {
38
- return {};
39
- }
40
- let remote;
41
- try {
42
- const remoteResult = await q("git", ["remote", "get-url", "origin"], {
43
- nodeOptions: { cwd: projectPath }
44
- });
45
- remote = remoteResult.stdout?.trim();
46
- } catch {
47
- }
48
- let branch;
49
- try {
50
- const branchResult = await q("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
51
- nodeOptions: { cwd: projectPath }
52
- });
53
- branch = branchResult.stdout?.trim();
54
- } catch {
55
- }
56
- return { remote, branch };
57
- } catch {
58
- return {};
59
- }
60
- }
61
- class ProjectHashCache {
62
- cache = /* @__PURE__ */ new Map();
63
- cacheTimeout = 5 * 60 * 1e3;
64
- // 5 minutes
65
- timestamps = /* @__PURE__ */ new Map();
66
- /**
67
- * Get or generate project identity
68
- *
69
- * @param projectPath - Project directory path
70
- * @param forceRefresh - Force cache refresh
71
- * @returns Project identity
72
- */
73
- async get(projectPath, forceRefresh = false) {
74
- let normalizedPath = normalize(projectPath);
75
- normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
76
- const now = Date.now();
77
- const timestamp = this.timestamps.get(normalizedPath);
78
- if (!forceRefresh && timestamp && now - timestamp < this.cacheTimeout) {
79
- const cached = this.cache.get(normalizedPath);
80
- if (cached) {
81
- return cached;
82
- }
83
- }
84
- const identity = await generateProjectHash(normalizedPath);
85
- this.cache.set(normalizedPath, identity);
86
- this.timestamps.set(normalizedPath, now);
87
- return identity;
88
- }
89
- /**
90
- * Clear cache for specific project or all projects
91
- *
92
- * @param projectPath - Optional project path to clear
93
- */
94
- clear(projectPath) {
95
- if (projectPath) {
96
- let normalizedPath = normalize(projectPath);
97
- normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
98
- this.cache.delete(normalizedPath);
99
- this.timestamps.delete(normalizedPath);
100
- } else {
101
- this.cache.clear();
102
- this.timestamps.clear();
103
- }
104
- }
105
- /**
106
- * Get cache statistics
107
- */
108
- getStats() {
109
- const timestamps = Array.from(this.timestamps.values());
110
- return {
111
- size: this.cache.size,
112
- oldestEntry: timestamps.length > 0 ? Math.min(...timestamps) : void 0
113
- };
114
- }
115
- }
116
- const projectHashCache = new ProjectHashCache();
117
- async function getProjectIdentity(projectPath, forceRefresh = false) {
118
- return projectHashCache.get(projectPath, forceRefresh);
119
- }
120
-
121
- const DB_PATH = join(homedir(), ".ccjk", "context", "contexts.db");
122
- const WAL_PATH = `${DB_PATH}-wal`;
123
- const BACKUP_DIR = join(homedir(), ".ccjk", "context", "backups");
124
- const WAL_SIZE_WARNING = 10 * 1024 * 1024;
125
- const WAL_SIZE_CRITICAL = 50 * 1024 * 1024;
126
- const DB_SIZE_WARNING = 100 * 1024 * 1024;
127
- const DB_SIZE_CRITICAL = 500 * 1024 * 1024;
128
- function label(text) {
129
- return a.gray(text);
130
- }
131
- function val(text) {
132
- return a.white(text);
133
- }
134
- function heading(text) {
135
- return a.cyan.bold(text);
136
- }
137
- function divider() {
138
- return a.gray("\u2500".repeat(50));
139
- }
140
- function formatBytes(bytes) {
141
- if (bytes === 0)
142
- return "0 B";
143
- const k = 1024;
144
- const sizes = ["B", "KB", "MB", "GB"];
145
- const i = Math.floor(Math.log(bytes) / Math.log(k));
146
- return `${(bytes / k ** i).toFixed(2)} ${sizes[i]}`;
147
- }
148
- function formatNumber(num) {
149
- return num.toLocaleString();
150
- }
151
- function formatPercentage(ratio) {
152
- return `${(ratio * 100).toFixed(1)}%`;
153
- }
154
- function formatDate(timestamp) {
155
- const date = new Date(timestamp);
156
- const now = Date.now();
157
- const diff = now - timestamp;
158
- if (diff < 6e4)
159
- return "just now";
160
- if (diff < 36e5)
161
- return `${Math.floor(diff / 6e4)}m ago`;
162
- if (diff < 864e5)
163
- return `${Math.floor(diff / 36e5)}h ago`;
164
- if (diff < 6048e5)
165
- return `${Math.floor(diff / 864e5)}d ago`;
166
- return date.toLocaleDateString();
167
- }
168
- function statusIcon(status) {
169
- switch (status) {
170
- case "green":
171
- return a.green("\u25CF");
172
- case "yellow":
173
- return a.yellow("\u25CF");
174
- case "red":
175
- return a.red("\u25CF");
176
- }
177
- }
178
- async function collectDashboardData() {
179
- const isZh = i18n.language === "zh-CN";
180
- const data = {
181
- compression: {
182
- sessionSavings: 0,
183
- weeklySavings: 0,
184
- monthlySavings: 0,
185
- compressionRatio: 0
186
- },
187
- persistence: {
188
- totalContexts: 0,
189
- databaseSize: 0
190
- },
191
- health: {
192
- status: "green",
193
- message: isZh ? "\u6570\u636E\u5E93\u5065\u5EB7" : "Database healthy",
194
- details: []
195
- },
196
- wal: {
197
- size: 0,
198
- needsCheckpoint: false,
199
- message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
200
- },
201
- tiers: {
202
- hot: 0,
203
- warm: 0,
204
- cold: 0
205
- },
206
- cacheHitRate: 0,
207
- recommendations: []
208
- };
209
- try {
210
- const { getContextPersistence } = await import('./persistence.mjs');
211
- const persistence = getContextPersistence();
212
- const stats = persistence.getStats();
213
- data.persistence.totalContexts = stats.totalContexts;
214
- data.persistence.databaseSize = stats.totalSize;
215
- if (stats.totalOriginalTokens > 0) {
216
- const _tokensSaved = stats.totalOriginalTokens - stats.totalCompressedTokens;
217
- data.compression.compressionRatio = stats.averageCompressionRatio;
218
- const oneHourAgo = Date.now() - 36e5;
219
- const recentContexts = persistence.queryContexts({
220
- startTime: oneHourAgo
221
- });
222
- data.compression.sessionSavings = recentContexts.reduce(
223
- (sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
224
- 0
225
- );
226
- const oneWeekAgo = Date.now() - 6048e5;
227
- const weeklyContexts = persistence.queryContexts({
228
- startTime: oneWeekAgo
229
- });
230
- data.compression.weeklySavings = weeklyContexts.reduce(
231
- (sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
232
- 0
233
- );
234
- const oneMonthAgo = Date.now() - 2592e6;
235
- const monthlyContexts = persistence.queryContexts({
236
- startTime: oneMonthAgo
237
- });
238
- data.compression.monthlySavings = monthlyContexts.reduce(
239
- (sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
240
- 0
241
- );
242
- }
243
- try {
244
- const projectIdentity = await getProjectIdentity(process__default.cwd());
245
- const projectHash = projectIdentity.hash;
246
- const hotContexts = persistence.getHotContexts(projectHash, 100);
247
- const warmContexts = persistence.getWarmContexts(projectHash, 100);
248
- const coldContexts = persistence.getColdContexts(projectHash, 100);
249
- data.tiers.hot = hotContexts.length;
250
- data.tiers.warm = warmContexts.length;
251
- data.tiers.cold = coldContexts.length;
252
- } catch {
253
- }
254
- data.cacheHitRate = 0.75;
255
- } catch {
256
- }
257
- data.health = checkDatabaseHealth(data.persistence.databaseSize);
258
- data.wal = checkWalStatus();
259
- data.recommendations = generateRecommendations(data);
260
- return data;
261
- }
262
- function checkDatabaseHealth(dbSize) {
263
- const isZh = i18n.language === "zh-CN";
264
- if (!existsSync(DB_PATH)) {
265
- return {
266
- status: "yellow",
267
- message: isZh ? "\u6570\u636E\u5E93\u672A\u521D\u59CB\u5316" : "Database not initialized",
268
- details: [isZh ? "\u9996\u6B21\u4F7F\u7528\u65F6\u4F1A\u81EA\u52A8\u521B\u5EFA" : "Will be created on first use"]
269
- };
270
- }
271
- if (dbSize > DB_SIZE_CRITICAL) {
272
- return {
273
- status: "red",
274
- message: isZh ? "\u6570\u636E\u5E93\u8FC7\u5927" : "Database too large",
275
- details: [
276
- isZh ? `\u5F53\u524D\u5927\u5C0F: ${formatBytes(dbSize)}` : `Current size: ${formatBytes(dbSize)}`,
277
- isZh ? "\u5EFA\u8BAE\u8FD0\u884C VACUUM \u6E05\u7406" : "Recommend running VACUUM"
278
- ]
279
- };
280
- }
281
- if (dbSize > DB_SIZE_WARNING) {
282
- return {
283
- status: "yellow",
284
- message: isZh ? "\u6570\u636E\u5E93\u8F83\u5927" : "Database size warning",
285
- details: [
286
- isZh ? `\u5F53\u524D\u5927\u5C0F: ${formatBytes(dbSize)}` : `Current size: ${formatBytes(dbSize)}`,
287
- isZh ? "\u8003\u8651\u6E05\u7406\u65E7\u6570\u636E" : "Consider cleaning old data"
288
- ]
289
- };
290
- }
291
- return {
292
- status: "green",
293
- message: isZh ? "\u6570\u636E\u5E93\u5065\u5EB7" : "Database healthy",
294
- details: [isZh ? `\u5927\u5C0F: ${formatBytes(dbSize)}` : `Size: ${formatBytes(dbSize)}`]
295
- };
296
- }
297
- function checkWalStatus() {
298
- const isZh = i18n.language === "zh-CN";
299
- if (!existsSync(WAL_PATH)) {
300
- return {
301
- size: 0,
302
- needsCheckpoint: false,
303
- message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
304
- };
305
- }
306
- const walSize = statSync(WAL_PATH).size;
307
- if (walSize > WAL_SIZE_CRITICAL) {
308
- return {
309
- size: walSize,
310
- needsCheckpoint: true,
311
- message: isZh ? "WAL \u8FC7\u5927\uFF0C\u9700\u8981\u68C0\u67E5\u70B9" : "WAL too large, checkpoint needed"
312
- };
313
- }
314
- if (walSize > WAL_SIZE_WARNING) {
315
- return {
316
- size: walSize,
317
- needsCheckpoint: true,
318
- message: isZh ? "WAL \u8F83\u5927\uFF0C\u5EFA\u8BAE\u68C0\u67E5\u70B9" : "WAL size warning, checkpoint recommended"
319
- };
320
- }
321
- return {
322
- size: walSize,
323
- needsCheckpoint: false,
324
- message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
325
- };
326
- }
327
- function generateRecommendations(data) {
328
- const isZh = i18n.language === "zh-CN";
329
- const recommendations = [];
330
- if (data.health.status === "red") {
331
- recommendations.push({
332
- priority: "high",
333
- title: isZh ? "\u6E05\u7406\u6570\u636E\u5E93" : "Clean database",
334
- description: isZh ? "\u6570\u636E\u5E93\u8FC7\u5927\uFF0C\u8FD0\u884C VACUUM \u56DE\u6536\u7A7A\u95F4" : "Database too large, run VACUUM to reclaim space",
335
- command: "ccjk brain vacuum"
336
- });
337
- }
338
- if (data.wal.needsCheckpoint) {
339
- recommendations.push({
340
- priority: data.wal.size > WAL_SIZE_CRITICAL ? "high" : "medium",
341
- title: isZh ? "\u6267\u884C\u68C0\u67E5\u70B9" : "Run checkpoint",
342
- description: isZh ? "WAL \u6587\u4EF6\u8FC7\u5927\uFF0C\u6267\u884C\u68C0\u67E5\u70B9\u5408\u5E76\u5230\u4E3B\u6570\u636E\u5E93" : "WAL file too large, run checkpoint to merge into main database",
343
- command: "ccjk brain checkpoint"
344
- });
345
- }
346
- if (!existsSync(BACKUP_DIR) || data.persistence.totalContexts > 100) {
347
- const lastBackup = data.persistence.lastBackup;
348
- const needsBackup = !lastBackup || Date.now() - lastBackup > 6048e5;
349
- if (needsBackup) {
350
- recommendations.push({
351
- priority: "medium",
352
- title: isZh ? "\u5907\u4EFD\u6570\u636E\u5E93" : "Backup database",
353
- description: isZh ? "\u5EFA\u8BAE\u5B9A\u671F\u5907\u4EFD\u4E0A\u4E0B\u6587\u6570\u636E\u5E93" : "Recommend regular database backups",
354
- command: "ccjk brain backup"
355
- });
356
- }
357
- }
358
- if (data.compression.compressionRatio < 0.3 && data.persistence.totalContexts > 10) {
359
- recommendations.push({
360
- priority: "low",
361
- title: isZh ? "\u4F18\u5316\u538B\u7F29\u7B56\u7565" : "Optimize compression",
362
- description: isZh ? "\u538B\u7F29\u7387\u8F83\u4F4E\uFF0C\u8003\u8651\u8C03\u6574\u538B\u7F29\u7B56\u7565" : "Low compression ratio, consider adjusting strategy",
363
- command: "ccjk brain config"
364
- });
365
- }
366
- return recommendations;
367
- }
368
- function renderCompressionSection(data) {
369
- const isZh = i18n.language === "zh-CN";
370
- const lines = [];
371
- lines.push(heading(isZh ? "\u{1F4CA} \u538B\u7F29\u6307\u6807" : "\u{1F4CA} Compression Metrics"));
372
- lines.push("");
373
- if (data.persistence.totalContexts === 0) {
374
- lines.push(` ${a.gray(isZh ? "\u6682\u65E0\u538B\u7F29\u6570\u636E" : "No compression data yet")}`);
375
- return lines;
376
- }
377
- lines.push(` ${label((isZh ? "\u4F1A\u8BDD\u8282\u7701:" : "Session savings:").padEnd(20))} ${val(formatNumber(data.compression.sessionSavings))} ${a.gray("tokens")}`);
378
- lines.push(` ${label((isZh ? "\u672C\u5468\u8282\u7701:" : "Weekly savings:").padEnd(20))} ${val(formatNumber(data.compression.weeklySavings))} ${a.gray("tokens")}`);
379
- lines.push(` ${label((isZh ? "\u672C\u6708\u8282\u7701:" : "Monthly savings:").padEnd(20))} ${val(formatNumber(data.compression.monthlySavings))} ${a.gray("tokens")}`);
380
- lines.push(` ${label((isZh ? "\u538B\u7F29\u7387:" : "Compression ratio:").padEnd(20))} ${val(formatPercentage(data.compression.compressionRatio))}`);
381
- return lines;
382
- }
383
- function renderPersistenceSection(data) {
384
- const isZh = i18n.language === "zh-CN";
385
- const lines = [];
386
- lines.push(heading(isZh ? "\u{1F4BE} \u6301\u4E45\u5316\u7EDF\u8BA1" : "\u{1F4BE} Persistence Stats"));
387
- lines.push("");
388
- lines.push(` ${label((isZh ? "\u5B58\u50A8\u4E0A\u4E0B\u6587:" : "Stored contexts:").padEnd(20))} ${val(formatNumber(data.persistence.totalContexts))}`);
389
- lines.push(` ${label((isZh ? "\u6570\u636E\u5E93\u5927\u5C0F:" : "Database size:").padEnd(20))} ${val(formatBytes(data.persistence.databaseSize))}`);
390
- if (data.persistence.lastBackup) {
391
- lines.push(` ${label((isZh ? "\u6700\u540E\u5907\u4EFD:" : "Last backup:").padEnd(20))} ${val(formatDate(data.persistence.lastBackup))}`);
392
- } else {
393
- lines.push(` ${label((isZh ? "\u6700\u540E\u5907\u4EFD:" : "Last backup:").padEnd(20))} ${a.gray(isZh ? "\u4ECE\u672A\u5907\u4EFD" : "Never")}`);
394
- }
395
- return lines;
396
- }
397
- function renderHealthSection(data) {
398
- const isZh = i18n.language === "zh-CN";
399
- const lines = [];
400
- lines.push(heading(isZh ? "\u{1F3E5} \u5065\u5EB7\u72B6\u6001" : "\u{1F3E5} Health Status"));
401
- lines.push("");
402
- lines.push(` ${label((isZh ? "\u6570\u636E\u5E93\u5B8C\u6574\u6027:" : "Database integrity:").padEnd(20))} ${statusIcon(data.health.status)} ${val(data.health.message)}`);
403
- for (const detail of data.health.details) {
404
- lines.push(` ${a.gray(detail)}`);
405
- }
406
- lines.push(` ${label((isZh ? "WAL \u72B6\u6001:" : "WAL status:").padEnd(20))} ${statusIcon(data.wal.needsCheckpoint ? "yellow" : "green")} ${val(data.wal.message)}`);
407
- if (data.wal.size > 0) {
408
- lines.push(` ${a.gray(`${isZh ? "\u5927\u5C0F" : "Size"}: ${formatBytes(data.wal.size)}`)}`);
409
- }
410
- const diskStatus = data.persistence.databaseSize > DB_SIZE_WARNING ? "yellow" : "green";
411
- lines.push(` ${label((isZh ? "\u78C1\u76D8\u4F7F\u7528:" : "Disk utilization:").padEnd(20))} ${statusIcon(diskStatus)} ${val(formatBytes(data.persistence.databaseSize))}`);
412
- return lines;
413
- }
414
- function renderTierSection(data) {
415
- const isZh = i18n.language === "zh-CN";
416
- const lines = [];
417
- lines.push(heading(isZh ? "\u{1F525} \u5C42\u7EA7\u5206\u5E03" : "\u{1F525} Tier Distribution"));
418
- lines.push("");
419
- const total = data.tiers.hot + data.tiers.warm + data.tiers.cold;
420
- if (total === 0) {
421
- lines.push(` ${a.gray(isZh ? "\u6682\u65E0\u5C42\u7EA7\u6570\u636E" : "No tier data yet")}`);
422
- return lines;
423
- }
424
- lines.push(` ${label((isZh ? "L0 (\u70ED):" : "L0 (Hot):").padEnd(20))} ${val(formatNumber(data.tiers.hot))} ${a.gray(`(${formatPercentage(data.tiers.hot / total)})`)}`);
425
- lines.push(` ${label((isZh ? "L1 (\u6E29):" : "L1 (Warm):").padEnd(20))} ${val(formatNumber(data.tiers.warm))} ${a.gray(`(${formatPercentage(data.tiers.warm / total)})`)}`);
426
- lines.push(` ${label((isZh ? "L2 (\u51B7):" : "L2 (Cold):").padEnd(20))} ${val(formatNumber(data.tiers.cold))} ${a.gray(`(${formatPercentage(data.tiers.cold / total)})`)}`);
427
- lines.push(` ${label((isZh ? "\u7F13\u5B58\u547D\u4E2D\u7387:" : "Cache hit rate:").padEnd(20))} ${val(formatPercentage(data.cacheHitRate))}`);
428
- return lines;
429
- }
430
- function renderRecommendationsSection(data) {
431
- const isZh = i18n.language === "zh-CN";
432
- const lines = [];
433
- if (data.recommendations.length === 0) {
434
- return lines;
435
- }
436
- lines.push("");
437
- lines.push(a.yellow.bold(isZh ? "\u{1F4A1} \u5EFA\u8BAE" : "\u{1F4A1} Recommendations"));
438
- lines.push("");
439
- for (const rec of data.recommendations) {
440
- const priority = rec.priority === "high" ? a.red("!") : rec.priority === "medium" ? a.yellow("\u2022") : a.gray("\xB7");
441
- lines.push(` ${priority} ${a.bold(rec.title)}`);
442
- lines.push(` ${a.gray(rec.description)}`);
443
- if (rec.command) {
444
- lines.push(` ${a.gray("\u2192")} ${a.cyan(rec.command)}`);
445
- }
446
- }
447
- return lines;
448
- }
449
- async function dashboardCommand(options = {}) {
450
- try {
451
- const data = await collectDashboardData();
452
- if (options.json) {
453
- console.log(JSON.stringify(data, null, 2));
454
- return;
455
- }
456
- const sections = [];
457
- sections.push(renderCompressionSection(data));
458
- sections.push(renderPersistenceSection(data));
459
- sections.push(renderHealthSection(data));
460
- sections.push(renderTierSection(data));
461
- const recommendations = renderRecommendationsSection(data);
462
- if (recommendations.length > 0) {
463
- sections.push(recommendations);
464
- }
465
- console.log();
466
- for (let i = 0; i < sections.length; i++) {
467
- console.log(sections[i].join("\n"));
468
- if (i < sections.length - 1) {
469
- console.log();
470
- console.log(divider());
471
- console.log();
472
- }
473
- }
474
- console.log();
475
- } catch (error) {
476
- console.error(a.red("Error running dashboard command:"), error);
477
- process__default.exit(1);
478
- }
479
- }
480
-
481
- export { dashboardCommand };