ccjk 12.0.7 → 12.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/package.json +1 -1
  2. package/dist/chunks/agent-teams.mjs +0 -136
  3. package/dist/chunks/agent.mjs +0 -1439
  4. package/dist/chunks/agents.mjs +0 -3778
  5. package/dist/chunks/api-cli.mjs +0 -132
  6. package/dist/chunks/api-providers.mjs +0 -129
  7. package/dist/chunks/api.mjs +0 -112
  8. package/dist/chunks/auto-bootstrap.mjs +0 -358
  9. package/dist/chunks/auto-init.mjs +0 -7584
  10. package/dist/chunks/auto-updater.mjs +0 -410
  11. package/dist/chunks/banner.mjs +0 -188
  12. package/dist/chunks/bash.mjs +0 -187
  13. package/dist/chunks/boost.mjs +0 -397
  14. package/dist/chunks/ccjk-agents.mjs +0 -414
  15. package/dist/chunks/ccjk-all.mjs +0 -1028
  16. package/dist/chunks/ccjk-config.mjs +0 -261
  17. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  18. package/dist/chunks/ccjk-mcp.mjs +0 -761
  19. package/dist/chunks/ccjk-setup.mjs +0 -763
  20. package/dist/chunks/ccjk-skills.mjs +0 -514
  21. package/dist/chunks/ccr.mjs +0 -98
  22. package/dist/chunks/ccu.mjs +0 -40
  23. package/dist/chunks/check-updates.mjs +0 -108
  24. package/dist/chunks/claude-code-config-manager.mjs +0 -750
  25. package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
  26. package/dist/chunks/claude-config.mjs +0 -236
  27. package/dist/chunks/claude-wrapper.mjs +0 -85
  28. package/dist/chunks/cleanup-migration.mjs +0 -20
  29. package/dist/chunks/cli-hook.mjs +0 -2285
  30. package/dist/chunks/cloud-sync.mjs +0 -29
  31. package/dist/chunks/codex-config-switch.mjs +0 -451
  32. package/dist/chunks/codex-provider-manager.mjs +0 -236
  33. package/dist/chunks/codex-uninstaller.mjs +0 -404
  34. package/dist/chunks/codex.mjs +0 -2077
  35. package/dist/chunks/commands.mjs +0 -108
  36. package/dist/chunks/commands2.mjs +0 -413
  37. package/dist/chunks/commit.mjs +0 -138
  38. package/dist/chunks/completion.mjs +0 -515
  39. package/dist/chunks/config-consolidator.mjs +0 -172
  40. package/dist/chunks/config-switch.mjs +0 -317
  41. package/dist/chunks/config.mjs +0 -379
  42. package/dist/chunks/config2.mjs +0 -477
  43. package/dist/chunks/config3.mjs +0 -470
  44. package/dist/chunks/constants.mjs +0 -133
  45. package/dist/chunks/context-loader.mjs +0 -343
  46. package/dist/chunks/context.mjs +0 -372
  47. package/dist/chunks/convoy-manager.mjs +0 -880
  48. package/dist/chunks/dashboard.mjs +0 -476
  49. package/dist/chunks/doctor.mjs +0 -964
  50. package/dist/chunks/evolution.mjs +0 -382
  51. package/dist/chunks/features.mjs +0 -698
  52. package/dist/chunks/fish.mjs +0 -181
  53. package/dist/chunks/fs-operations.mjs +0 -192
  54. package/dist/chunks/health-alerts.mjs +0 -304
  55. package/dist/chunks/health-check.mjs +0 -532
  56. package/dist/chunks/help.mjs +0 -340
  57. package/dist/chunks/hook-installer.mjs +0 -45
  58. package/dist/chunks/index.mjs +0 -24
  59. package/dist/chunks/index10.mjs +0 -1171
  60. package/dist/chunks/index11.mjs +0 -1008
  61. package/dist/chunks/index12.mjs +0 -193
  62. package/dist/chunks/index13.mjs +0 -218
  63. package/dist/chunks/index14.mjs +0 -663
  64. package/dist/chunks/index2.mjs +0 -19
  65. package/dist/chunks/index3.mjs +0 -19092
  66. package/dist/chunks/index4.mjs +0 -8
  67. package/dist/chunks/index5.mjs +0 -7600
  68. package/dist/chunks/index6.mjs +0 -171
  69. package/dist/chunks/index7.mjs +0 -3583
  70. package/dist/chunks/index8.mjs +0 -19
  71. package/dist/chunks/index9.mjs +0 -616
  72. package/dist/chunks/init.mjs +0 -1606
  73. package/dist/chunks/installer.mjs +0 -690
  74. package/dist/chunks/installer2.mjs +0 -179
  75. package/dist/chunks/interview.mjs +0 -2927
  76. package/dist/chunks/json-config.mjs +0 -60
  77. package/dist/chunks/linux.mjs +0 -3863
  78. package/dist/chunks/macos.mjs +0 -69
  79. package/dist/chunks/main.mjs +0 -635
  80. package/dist/chunks/manager.mjs +0 -1048
  81. package/dist/chunks/marketplace.mjs +0 -949
  82. package/dist/chunks/mcp-cli.mjs +0 -204
  83. package/dist/chunks/mcp-performance.mjs +0 -187
  84. package/dist/chunks/mcp.mjs +0 -1231
  85. package/dist/chunks/menu.mjs +0 -652
  86. package/dist/chunks/metrics-display.mjs +0 -153
  87. package/dist/chunks/migrator.mjs +0 -178
  88. package/dist/chunks/monitor.mjs +0 -1856
  89. package/dist/chunks/notification.mjs +0 -1864
  90. package/dist/chunks/onboarding.mjs +0 -385
  91. package/dist/chunks/package.mjs +0 -3
  92. package/dist/chunks/paradigm.mjs +0 -74
  93. package/dist/chunks/permission-manager.mjs +0 -132
  94. package/dist/chunks/permissions.mjs +0 -265
  95. package/dist/chunks/persistence-manager.mjs +0 -794
  96. package/dist/chunks/persistence.mjs +0 -667
  97. package/dist/chunks/platform.mjs +0 -391
  98. package/dist/chunks/plugin.mjs +0 -1936
  99. package/dist/chunks/powershell.mjs +0 -213
  100. package/dist/chunks/prompts.mjs +0 -241
  101. package/dist/chunks/providers.mjs +0 -260
  102. package/dist/chunks/quick-actions.mjs +0 -320
  103. package/dist/chunks/quick-provider.mjs +0 -682
  104. package/dist/chunks/quick-setup.mjs +0 -412
  105. package/dist/chunks/remote.mjs +0 -497
  106. package/dist/chunks/session.mjs +0 -878
  107. package/dist/chunks/sessions.mjs +0 -106
  108. package/dist/chunks/silent-updater.mjs +0 -396
  109. package/dist/chunks/simple-config.mjs +0 -98
  110. package/dist/chunks/skill.mjs +0 -117
  111. package/dist/chunks/skill2.mjs +0 -9003
  112. package/dist/chunks/skills-sync.mjs +0 -6460
  113. package/dist/chunks/skills.mjs +0 -567
  114. package/dist/chunks/slash-commands.mjs +0 -207
  115. package/dist/chunks/smart-defaults.mjs +0 -412
  116. package/dist/chunks/smart-guide.mjs +0 -194
  117. package/dist/chunks/startup.mjs +0 -487
  118. package/dist/chunks/stats.mjs +0 -410
  119. package/dist/chunks/status.mjs +0 -289
  120. package/dist/chunks/team.mjs +0 -63
  121. package/dist/chunks/thinking.mjs +0 -626
  122. package/dist/chunks/trace.mjs +0 -57
  123. package/dist/chunks/uninstall.mjs +0 -849
  124. package/dist/chunks/update.mjs +0 -167
  125. package/dist/chunks/upgrade-manager.mjs +0 -204
  126. package/dist/chunks/version-checker.mjs +0 -881
  127. package/dist/chunks/vim.mjs +0 -903
  128. package/dist/chunks/windows.mjs +0 -14
  129. package/dist/chunks/workflows.mjs +0 -633
  130. package/dist/chunks/wsl.mjs +0 -129
  131. package/dist/chunks/zero-config.mjs +0 -374
  132. package/dist/chunks/zsh.mjs +0 -182
  133. package/dist/cli.d.mts +0 -1
  134. package/dist/cli.d.ts +0 -1
  135. package/dist/cli.mjs +0 -2199
  136. package/dist/i18n/locales/en/agent-teams.json +0 -18
  137. package/dist/i18n/locales/en/agentBrowser.json +0 -79
  138. package/dist/i18n/locales/en/agents.json +0 -135
  139. package/dist/i18n/locales/en/api.json +0 -63
  140. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  141. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  142. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  143. package/dist/i18n/locales/en/ccjk.json +0 -276
  144. package/dist/i18n/locales/en/ccr.json +0 -65
  145. package/dist/i18n/locales/en/claude-md.json +0 -73
  146. package/dist/i18n/locales/en/cli.json +0 -152
  147. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  148. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  149. package/dist/i18n/locales/en/cloud.json +0 -40
  150. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  151. package/dist/i18n/locales/en/codex.json +0 -127
  152. package/dist/i18n/locales/en/cometix.json +0 -29
  153. package/dist/i18n/locales/en/common.json +0 -68
  154. package/dist/i18n/locales/en/config.json +0 -108
  155. package/dist/i18n/locales/en/configuration.json +0 -226
  156. package/dist/i18n/locales/en/context.json +0 -85
  157. package/dist/i18n/locales/en/dashboard.json +0 -78
  158. package/dist/i18n/locales/en/errors.json +0 -26
  159. package/dist/i18n/locales/en/evolution.json +0 -54
  160. package/dist/i18n/locales/en/hooks.json +0 -74
  161. package/dist/i18n/locales/en/hooksSync.json +0 -133
  162. package/dist/i18n/locales/en/installation.json +0 -83
  163. package/dist/i18n/locales/en/interview.json +0 -104
  164. package/dist/i18n/locales/en/language.json +0 -19
  165. package/dist/i18n/locales/en/lsp.json +0 -78
  166. package/dist/i18n/locales/en/marketplace.json +0 -116
  167. package/dist/i18n/locales/en/mcp.json +0 -178
  168. package/dist/i18n/locales/en/memory.json +0 -92
  169. package/dist/i18n/locales/en/menu.json +0 -143
  170. package/dist/i18n/locales/en/multi-config.json +0 -79
  171. package/dist/i18n/locales/en/notification.json +0 -307
  172. package/dist/i18n/locales/en/permissions.json +0 -95
  173. package/dist/i18n/locales/en/persistence.json +0 -127
  174. package/dist/i18n/locales/en/plugins.json +0 -146
  175. package/dist/i18n/locales/en/quick-actions.json +0 -78
  176. package/dist/i18n/locales/en/registry.json +0 -54
  177. package/dist/i18n/locales/en/remote.json +0 -93
  178. package/dist/i18n/locales/en/sandbox.json +0 -44
  179. package/dist/i18n/locales/en/setup.json +0 -44
  180. package/dist/i18n/locales/en/shencha.json +0 -14
  181. package/dist/i18n/locales/en/skills.json +0 -100
  182. package/dist/i18n/locales/en/skillsSync.json +0 -74
  183. package/dist/i18n/locales/en/smartGuide.json +0 -49
  184. package/dist/i18n/locales/en/stats.json +0 -20
  185. package/dist/i18n/locales/en/subagent.json +0 -69
  186. package/dist/i18n/locales/en/superpowers.json +0 -117
  187. package/dist/i18n/locales/en/team.json +0 -7
  188. package/dist/i18n/locales/en/thinking.json +0 -65
  189. package/dist/i18n/locales/en/tools.json +0 -42
  190. package/dist/i18n/locales/en/uninstall.json +0 -56
  191. package/dist/i18n/locales/en/updater.json +0 -29
  192. package/dist/i18n/locales/en/vim.json +0 -169
  193. package/dist/i18n/locales/en/workflow.json +0 -55
  194. package/dist/i18n/locales/en/workspace.json +0 -108
  195. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  196. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
  197. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  198. package/dist/i18n/locales/zh-CN/api.json +0 -63
  199. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  200. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  201. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  202. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  203. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  204. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  205. package/dist/i18n/locales/zh-CN/cli.json +0 -152
  206. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  207. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  208. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  209. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  210. package/dist/i18n/locales/zh-CN/codex.json +0 -127
  211. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  212. package/dist/i18n/locales/zh-CN/common.json +0 -68
  213. package/dist/i18n/locales/zh-CN/config.json +0 -108
  214. package/dist/i18n/locales/zh-CN/configuration.json +0 -224
  215. package/dist/i18n/locales/zh-CN/context.json +0 -85
  216. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  217. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  218. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  219. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  220. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  221. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  222. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  223. package/dist/i18n/locales/zh-CN/language.json +0 -19
  224. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  225. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  226. package/dist/i18n/locales/zh-CN/mcp.json +0 -178
  227. package/dist/i18n/locales/zh-CN/memory.json +0 -92
  228. package/dist/i18n/locales/zh-CN/menu.json +0 -143
  229. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  230. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  231. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  232. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  233. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  234. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  235. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  236. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  237. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  238. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  239. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  240. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  241. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  242. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  243. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  244. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  245. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  246. package/dist/i18n/locales/zh-CN/team.json +0 -7
  247. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  248. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  249. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  250. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  251. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  252. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  253. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  254. package/dist/index.d.mts +0 -5295
  255. package/dist/index.d.ts +0 -5295
  256. package/dist/index.mjs +0 -4941
  257. package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
  258. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  259. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  260. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  261. package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
  262. package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
  263. package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
  264. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  265. package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
  266. package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
  267. package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
  268. package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
  269. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  270. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  271. package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
  272. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  273. package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
  274. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  275. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  276. package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
  277. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  278. package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
  279. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  280. package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
  281. package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
  282. package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
  283. package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
  284. package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
  285. package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
  286. package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
  287. package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
  288. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  289. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  290. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  291. package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
  292. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  293. package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
  294. package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
  295. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  296. package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
  297. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  298. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  299. package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
@@ -1,207 +0,0 @@
1
- import a from './index2.mjs';
2
- import { i18n } from './index5.mjs';
3
- import { getContextPersistence } from './persistence.mjs';
4
- import '../shared/ccjk.BAGoDD49.mjs';
5
- import 'node:fs';
6
- import 'node:process';
7
- import 'node:url';
8
- import '../shared/ccjk.bQ7Dh1g4.mjs';
9
- import 'better-sqlite3';
10
-
11
- function parseSlashCommand(input) {
12
- const trimmed = input.trim();
13
- if (!trimmed.startsWith("/")) {
14
- return null;
15
- }
16
- const parts = trimmed.slice(1).split(/\s+/);
17
- const command = parts[0].toLowerCase();
18
- const args = parts.slice(1);
19
- return { command, args };
20
- }
21
- function getSlashCommands() {
22
- return [
23
- {
24
- name: "status",
25
- aliases: ["s"],
26
- description: "Show Brain Dashboard with health score",
27
- descriptionZh: "\u663E\u793A Brain \u4EEA\u8868\u677F\u548C\u5065\u5EB7\u8BC4\u5206",
28
- category: "brain",
29
- handler: async () => {
30
- const { statusCommand } = await import('./status.mjs');
31
- await statusCommand({ compact: false });
32
- }
33
- },
34
- {
35
- name: "health",
36
- aliases: ["h"],
37
- description: "Run comprehensive health check",
38
- descriptionZh: "\u8FD0\u884C\u5168\u9762\u5065\u5EB7\u68C0\u67E5",
39
- category: "brain",
40
- handler: async () => {
41
- const { runHealthCheck } = await import('./index4.mjs');
42
- const report = await runHealthCheck();
43
- console.log(a.cyan.bold("\n\u{1F3E5} Health Check Results\n"));
44
- console.log(`${a.gray("Overall Score:")} ${a.green.bold(report.totalScore + "/100")}`);
45
- console.log(`${a.gray("Grade:")} ${a.green.bold(report.grade)}`);
46
- if (report.recommendations.length > 0) {
47
- console.log(a.yellow.bold("\n\u{1F4A1} Recommendations:\n"));
48
- report.recommendations.forEach((rec, i) => {
49
- console.log(`${a.yellow(i + 1 + ".")} ${rec.description}`);
50
- if (rec.command) {
51
- console.log(` ${a.gray("\u2192")} ${a.cyan(rec.command)}`);
52
- }
53
- });
54
- }
55
- console.log();
56
- }
57
- },
58
- {
59
- name: "search",
60
- aliases: ["find", "query"],
61
- description: "Search contexts using FTS5 full-text search",
62
- descriptionZh: "\u4F7F\u7528 FTS5 \u5168\u6587\u641C\u7D22\u4E0A\u4E0B\u6587",
63
- category: "context",
64
- handler: async (args) => {
65
- if (args.length === 0) {
66
- console.log(a.yellow("Usage: /search <query>"));
67
- console.log(a.gray('Example: /search "authentication logic"'));
68
- return;
69
- }
70
- const query = args.join(" ");
71
- const persistence = getContextPersistence();
72
- const results = await persistence.searchContexts(query, { limit: 10 });
73
- if (results.length === 0) {
74
- console.log(a.yellow(`No results found for: ${query}`));
75
- return;
76
- }
77
- console.log(a.cyan.bold(`
78
- \u{1F50D} Search Results (${results.length})
79
- `));
80
- results.forEach((result, i) => {
81
- console.log(a.white.bold(`${i + 1}. ${result.id}`));
82
- console.log(` ${a.gray("Rank:")} ${a.yellow(result.rank.toFixed(2))}`);
83
- console.log(` ${a.gray("Tokens:")} ${result.originalTokens} \u2192 ${result.compressedTokens}`);
84
- console.log(` ${a.gray("Algorithm:")} ${result.algorithm}`);
85
- if (result.snippet) {
86
- console.log(` ${a.gray("Snippet:")} ${a.dim(result.snippet)}`);
87
- }
88
- console.log();
89
- });
90
- }
91
- },
92
- {
93
- name: "compress",
94
- aliases: ["stats", "metrics"],
95
- description: "Show compression statistics and metrics",
96
- descriptionZh: "\u663E\u793A\u538B\u7F29\u7EDF\u8BA1\u548C\u6307\u6807",
97
- category: "context",
98
- handler: async () => {
99
- const persistence = getContextPersistence();
100
- const stats = persistence.getCompressionMetricsStats();
101
- const { displayCompressionStats } = await import('./metrics-display.mjs');
102
- displayCompressionStats(stats);
103
- }
104
- },
105
- {
106
- name: "tasks",
107
- aliases: ["task", "t"],
108
- description: "Open task manager (Brain system)",
109
- descriptionZh: "\u6253\u5F00\u4EFB\u52A1\u7BA1\u7406\u5668\uFF08Brain \u7CFB\u7EDF\uFF09",
110
- category: "brain",
111
- handler: async () => {
112
- console.log(a.cyan.bold("\n\u{1F4CB} Task Manager\n"));
113
- console.log(a.yellow("Task management is integrated with Brain system."));
114
- console.log(a.gray("Use: ccjk status --tasks to view active tasks"));
115
- console.log();
116
- }
117
- },
118
- {
119
- name: "backup",
120
- aliases: ["save"],
121
- description: "Create configuration backup",
122
- descriptionZh: "\u521B\u5EFA\u914D\u7F6E\u5907\u4EFD",
123
- category: "system",
124
- handler: async () => {
125
- const { backupExistingConfig } = await import('./config.mjs').then(function (n) { return n.j; });
126
- const backupPath = backupExistingConfig();
127
- if (backupPath) {
128
- console.log(a.green(`\u2705 Backup created: ${backupPath}`));
129
- } else {
130
- console.log(a.yellow("\u26A0\uFE0F No configuration to backup"));
131
- }
132
- }
133
- },
134
- {
135
- name: "optimize",
136
- aliases: ["vacuum", "cleanup"],
137
- description: "Run VACUUM + checkpoint on context database",
138
- descriptionZh: "\u5BF9\u4E0A\u4E0B\u6587\u6570\u636E\u5E93\u8FD0\u884C VACUUM + checkpoint",
139
- category: "context",
140
- handler: async () => {
141
- console.log(a.cyan("\u{1F5DC}\uFE0F Optimizing context database..."));
142
- const persistence = getContextPersistence();
143
- persistence.vacuum();
144
- console.log(a.green("\u2705 Database optimized (VACUUM completed)"));
145
- }
146
- },
147
- {
148
- name: "help",
149
- aliases: ["?", "commands"],
150
- description: "Show all CCJK slash commands",
151
- descriptionZh: "\u663E\u793A\u6240\u6709 CCJK \u659C\u6760\u547D\u4EE4",
152
- category: "system",
153
- handler: async () => {
154
- displaySlashCommandsHelp();
155
- }
156
- }
157
- ];
158
- }
159
- async function executeSlashCommand(input) {
160
- const parsed = parseSlashCommand(input);
161
- if (!parsed) {
162
- return false;
163
- }
164
- const commands = getSlashCommands();
165
- const command = commands.find(
166
- (cmd) => cmd.name === parsed.command || cmd.aliases?.includes(parsed.command)
167
- );
168
- if (!command) {
169
- console.log(a.yellow(`Unknown command: /${parsed.command}`));
170
- console.log(a.gray("Type /help to see all available commands"));
171
- return true;
172
- }
173
- try {
174
- await command.handler(parsed.args);
175
- return true;
176
- } catch (error) {
177
- console.error(a.red(`Error executing /${parsed.command}:`), error);
178
- return true;
179
- }
180
- }
181
- function displaySlashCommandsHelp() {
182
- const isZh = i18n.language === "zh-CN";
183
- const commands = getSlashCommands();
184
- console.log(a.cyan.bold("\n\u{1F4A1} CCJK Slash Commands\n"));
185
- const categories = {
186
- brain: { title: isZh ? "\u{1F9E0} Brain \u7CFB\u7EDF" : "\u{1F9E0} Brain System", commands: [] },
187
- context: { title: isZh ? "\u{1F4E6} \u4E0A\u4E0B\u6587\u7BA1\u7406" : "\u{1F4E6} Context Management", commands: [] },
188
- system: { title: isZh ? "\u2699\uFE0F \u7CFB\u7EDF\u5DE5\u5177" : "\u2699\uFE0F System Tools", commands: [] }
189
- };
190
- commands.forEach((cmd) => {
191
- categories[cmd.category].commands.push(cmd);
192
- });
193
- Object.values(categories).forEach((category) => {
194
- if (category.commands.length === 0) return;
195
- console.log(a.white.bold(category.title));
196
- category.commands.forEach((cmd) => {
197
- const aliases = cmd.aliases ? a.gray(` (${cmd.aliases.map((a) => `/${a}`).join(", ")})`) : "";
198
- const desc = isZh ? cmd.descriptionZh : cmd.description;
199
- console.log(` ${a.green(`/${cmd.name}`)}${aliases}`);
200
- console.log(` ${a.gray(desc)}`);
201
- });
202
- console.log();
203
- });
204
- console.log(a.gray("Tip: Type /help or /? to see this message again\n"));
205
- }
206
-
207
- export { displaySlashCommandsHelp, executeSlashCommand, getSlashCommands, parseSlashCommand };
@@ -1,412 +0,0 @@
1
- import { execSync } from 'node:child_process';
2
- import { existsSync, readFileSync } from 'node:fs';
3
- import { homedir } from 'node:os';
4
- import { CCJK_CONFIG_DIR } from './constants.mjs';
5
- import { writeJsonConfig } from './json-config.mjs';
6
- import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
7
- import { g as getPlatform } from './platform.mjs';
8
- import { s as scanProject } from '../shared/ccjk.BrPUmTqm.mjs';
9
-
10
- const ORCHESTRATION_LEVELS = ["off", "minimal", "standard", "max"];
11
- function parseOrchestrationLevel(value) {
12
- if (!value) {
13
- return "max";
14
- }
15
- const normalized = value.trim().toLowerCase();
16
- if (ORCHESTRATION_LEVELS.includes(normalized)) {
17
- return normalized;
18
- }
19
- throw new Error(`Invalid orchestration level: ${value}. Valid values: ${ORCHESTRATION_LEVELS.join(", ")}`);
20
- }
21
- function buildDefaults(level) {
22
- if (level === "off") {
23
- return {
24
- planForNonTrivial: false,
25
- useSubagentsForResearch: false,
26
- verifyBeforeDone: false,
27
- rootCauseFirst: true,
28
- lessonsLoop: false
29
- };
30
- }
31
- if (level === "minimal") {
32
- return {
33
- planForNonTrivial: true,
34
- useSubagentsForResearch: false,
35
- verifyBeforeDone: true,
36
- rootCauseFirst: true,
37
- lessonsLoop: false
38
- };
39
- }
40
- if (level === "max") {
41
- return {
42
- planForNonTrivial: true,
43
- useSubagentsForResearch: true,
44
- verifyBeforeDone: true,
45
- rootCauseFirst: true,
46
- lessonsLoop: true
47
- };
48
- }
49
- return {
50
- planForNonTrivial: true,
51
- useSubagentsForResearch: true,
52
- verifyBeforeDone: true,
53
- rootCauseFirst: true,
54
- lessonsLoop: true
55
- };
56
- }
57
- function resolveOrchestrationLevelFromRuntime(runtime) {
58
- if (!runtime) {
59
- return "max";
60
- }
61
- if (runtime.isCI || runtime.isContainer) {
62
- return "minimal";
63
- }
64
- if (runtime.isSSH) {
65
- return "minimal";
66
- }
67
- return "max";
68
- }
69
- function writeOrchestrationPolicy(params) {
70
- const filePath = join(CCJK_CONFIG_DIR, "orchestration.json");
71
- const policy = {
72
- version: "1.0.0",
73
- enabled: params.level !== "off",
74
- level: params.level,
75
- language: params.language,
76
- defaults: buildDefaults(params.level),
77
- generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
78
- source: params.source
79
- };
80
- writeJsonConfig(filePath, policy, { atomic: true });
81
- return filePath;
82
- }
83
-
84
- class SmartDefaultsDetector {
85
- /**
86
- * Detect environment and generate smart defaults
87
- */
88
- async detect(cwd) {
89
- const platform = getPlatform();
90
- const apiKey = this.detectApiKey();
91
- const apiProvider = this.detectApiProvider(apiKey);
92
- const ccVersion = this.detectClaudeCodeVersion();
93
- const projectContext = scanProject(cwd);
94
- return {
95
- // Environment detection
96
- platform,
97
- homeDir: homedir(),
98
- // API configuration
99
- apiKey,
100
- apiProvider,
101
- // Recommended MCP services based on platform + project
102
- mcpServices: this.getRecommendedMcpServices(platform, projectContext),
103
- // Essential skills — reduced in CI/container (non-interactive)
104
- skills: projectContext.runtime.isCI || projectContext.runtime.isContainer ? ["ccjk:git-commit"] : [
105
- "ccjk:git-commit",
106
- "ccjk:feat",
107
- "ccjk:workflow",
108
- "ccjk:init-project",
109
- "ccjk:git-worktree"
110
- ],
111
- // Core agents — skip in CI/container (non-interactive)
112
- agents: projectContext.runtime.isCI || projectContext.runtime.isContainer ? [] : [
113
- "typescript-cli-architect",
114
- "ccjk-testing-specialist"
115
- ],
116
- // Code tool detection
117
- codeToolType: this.detectCodeToolType(),
118
- // Workflow preferences
119
- workflows: {
120
- outputStyle: "engineer-professional",
121
- gitWorkflow: projectContext.usesConventionalCommits ? "conventional-commits" : "conventional-commits",
122
- sixStepWorkflow: true,
123
- orchestrationLevel: resolveOrchestrationLevelFromRuntime(projectContext.runtime)
124
- },
125
- // Tool integrations
126
- tools: {
127
- ccr: this.shouldEnableCCR(),
128
- cometix: this.shouldEnableCometix(),
129
- ccusage: this.shouldEnableCCUsage()
130
- },
131
- // Claude Code native features
132
- claudeCodeVersion: ccVersion,
133
- nativeFeatures: this.detectNativeFeatures(ccVersion),
134
- // Project context
135
- projectContext,
136
- // Recommended hooks based on project toolchain
137
- recommendedHooks: this.getRecommendedHooks(projectContext),
138
- // SSH session flag for quick-setup notice
139
- sshDetected: projectContext.runtime.isSSH || void 0
140
- };
141
- }
142
- /**
143
- * Detect installed Claude Code version
144
- */
145
- detectClaudeCodeVersion() {
146
- try {
147
- const output = execSync('claude --version 2>/dev/null || echo ""', {
148
- encoding: "utf-8",
149
- timeout: 5e3
150
- }).trim();
151
- const match = output.match(/(\d+\.\d+\.\d+)/);
152
- return match ? match[1] : void 0;
153
- } catch {
154
- return void 0;
155
- }
156
- }
157
- /**
158
- * Detect which Claude Code native features are available
159
- * based on installed version
160
- */
161
- detectNativeFeatures(version) {
162
- return {
163
- hooks: this.versionSupports(version, "1.0.6"),
164
- plansDirectory: this.versionSupports(version, "1.0.10"),
165
- memory: this.versionSupports(version, "1.0.12"),
166
- subagents: this.versionSupports(version, "1.0.3"),
167
- toolSearch: this.versionSupports(version, "1.0.10"),
168
- statusLine: this.versionSupports(version, "1.0.8")
169
- };
170
- }
171
- /**
172
- * Check if a version meets the minimum requirement
173
- */
174
- versionSupports(version, minVersion) {
175
- if (!version)
176
- return false;
177
- const parts = version.split(".").map(Number);
178
- const minParts = minVersion.split(".").map(Number);
179
- for (let i = 0; i < 3; i++) {
180
- if ((parts[i] || 0) > (minParts[i] || 0))
181
- return true;
182
- if ((parts[i] || 0) < (minParts[i] || 0))
183
- return false;
184
- }
185
- return true;
186
- }
187
- /**
188
- * Detect API key from environment variables
189
- */
190
- detectApiKey() {
191
- const envVars = [
192
- "ANTHROPIC_API_KEY",
193
- "CLAUDE_API_KEY",
194
- "API_KEY"
195
- ];
196
- for (const envVar of envVars) {
197
- const value = process.env[envVar];
198
- if (value && value.length >= 10) {
199
- return value;
200
- }
201
- }
202
- const claudeConfigPath = join(homedir(), ".config", "claude", "config.json");
203
- if (existsSync(claudeConfigPath)) {
204
- try {
205
- const configContent = readFileSync(claudeConfigPath, "utf-8");
206
- const config = JSON.parse(configContent);
207
- if (config.apiKey && config.apiKey.length >= 10) {
208
- return config.apiKey;
209
- }
210
- } catch {
211
- }
212
- }
213
- return void 0;
214
- }
215
- /**
216
- * Detect API provider based on API key pattern
217
- */
218
- detectApiProvider(apiKey) {
219
- if (!apiKey) {
220
- return void 0;
221
- }
222
- if (apiKey.startsWith("sk-ant-")) {
223
- return "anthropic";
224
- }
225
- return void 0;
226
- }
227
- /**
228
- * Detect installed code tool type (instance method delegates to static)
229
- */
230
- detectCodeToolType() {
231
- return SmartDefaultsDetector.detectCodeToolType();
232
- }
233
- /**
234
- * Detect installed code tool type by checking filesystem markers.
235
- * This is a static method so it can be called without instantiating the full detector.
236
- */
237
- static detectCodeToolType() {
238
- const claudeCodePaths = [
239
- join(homedir(), ".claude"),
240
- join(homedir(), ".config", "claude")
241
- ];
242
- if (claudeCodePaths.some((p) => existsSync(p))) {
243
- return "claude-code";
244
- }
245
- const codexPath = join(homedir(), ".codex");
246
- if (existsSync(codexPath)) {
247
- return "codex";
248
- }
249
- return "claude-code";
250
- }
251
- /**
252
- * Check if CCR (Claude Code Router) should be enabled
253
- */
254
- shouldEnableCCR() {
255
- const ccrPaths = [
256
- join(homedir(), ".local", "bin", "ccr"),
257
- join(homedir(), ".cargo", "bin", "ccr"),
258
- "/usr/local/bin/ccr"
259
- ];
260
- return ccrPaths.some((path) => existsSync(path));
261
- }
262
- /**
263
- * Check if Cometix should be enabled
264
- */
265
- shouldEnableCometix() {
266
- const cometixPaths = [
267
- join(homedir(), ".local", "bin", "cometix"),
268
- join(homedir(), ".cargo", "bin", "cometix"),
269
- "/usr/local/bin/cometix"
270
- ];
271
- return cometixPaths.some((path) => existsSync(path));
272
- }
273
- /**
274
- * Check if CCUsage should be enabled
275
- */
276
- shouldEnableCCUsage() {
277
- const ccusagePaths = [
278
- join(homedir(), ".local", "bin", "ccusage"),
279
- join(homedir(), ".cargo", "bin", "ccusage"),
280
- "/usr/local/bin/ccusage"
281
- ];
282
- return ccusagePaths.some((path) => existsSync(path));
283
- }
284
- /**
285
- * Get recommended MCP services based on environment + project context
286
- */
287
- getRecommendedMcpServices(platform, project) {
288
- const runtime = project?.runtime;
289
- if (runtime?.isCI) {
290
- return ["context7", "mcp-deepwiki"];
291
- }
292
- if (runtime?.isContainer) {
293
- return ["context7", "mcp-deepwiki"];
294
- }
295
- const core = ["context7", "mcp-deepwiki", "open-websearch"];
296
- const extras = [];
297
- const hasBrowser = runtime?.hasBrowser ?? (platform === "darwin" || platform === "win32");
298
- if (hasBrowser) {
299
- extras.push("Playwright");
300
- }
301
- extras.push("sqlite");
302
- if (project && ["typescript", "java", "csharp"].includes(project.language)) {
303
- if (!runtime?.isHeadless) {
304
- extras.push("serena");
305
- }
306
- }
307
- return [...core, ...extras];
308
- }
309
- /**
310
- * Get recommended hook template IDs based on project toolchain
311
- */
312
- getRecommendedHooks(project) {
313
- const runtime = project.runtime;
314
- if (runtime.isCI) {
315
- const hooks2 = [];
316
- if (project.linter !== "none") hooks2.push("pre-commit-lint-check");
317
- if (project.testRunner !== "none") hooks2.push("test-before-commit");
318
- return hooks2;
319
- }
320
- if (runtime.isContainer) {
321
- const hooks2 = [];
322
- if (project.linter !== "none") hooks2.push("pre-commit-lint-check");
323
- if (project.testRunner !== "none") hooks2.push("test-before-commit");
324
- return hooks2;
325
- }
326
- const hooks = [];
327
- if (!runtime.isHeadless) {
328
- hooks.push("block-dev-server");
329
- }
330
- hooks.push("git-push-confirm");
331
- const jsLangs = ["typescript", "javascript"];
332
- if (jsLangs.includes(project.language)) {
333
- hooks.push("warn-console-log");
334
- }
335
- hooks.push("block-unwanted-docs");
336
- if (project.testRunner !== "none") {
337
- hooks.push("test-before-commit");
338
- }
339
- if (project.formatter !== "none") {
340
- hooks.push("auto-format-on-save");
341
- }
342
- if (project.linter !== "none") {
343
- hooks.push("pre-commit-lint-check");
344
- }
345
- return hooks;
346
- }
347
- /**
348
- * Get recommended skills based on user type
349
- */
350
- getRecommendedSkills(userType = "intermediate") {
351
- const core = [
352
- "ccjk:git-commit",
353
- "ccjk:init-project"
354
- ];
355
- if (userType === "beginner") {
356
- return [...core, "ccjk:workflow"];
357
- }
358
- if (userType === "intermediate") {
359
- return [...core, "ccjk:feat", "ccjk:workflow", "ccjk:git-worktree"];
360
- }
361
- if (userType === "advanced") {
362
- return [
363
- ...core,
364
- "ccjk:feat",
365
- "ccjk:workflow",
366
- "ccjk:git-worktree",
367
- "ccjk:git-rollback",
368
- "ccjk:git-cleanBranches"
369
- ];
370
- }
371
- return core;
372
- }
373
- /**
374
- * Validate detected defaults
375
- */
376
- validateDefaults(defaults) {
377
- const issues = [];
378
- if (defaults.apiKey) {
379
- if (defaults.apiKey.length < 10) {
380
- issues.push("API key appears too short to be valid");
381
- } else if (defaults.apiProvider === "anthropic" && !defaults.apiKey.startsWith("sk-ant-")) {
382
- issues.push("API key format appears invalid (should start with sk-ant-)");
383
- }
384
- }
385
- if (!["darwin", "linux", "win32"].includes(defaults.platform)) {
386
- issues.push(`Platform ${defaults.platform} may not be fully supported`);
387
- }
388
- if (!existsSync(defaults.homeDir)) {
389
- issues.push("Home directory is not accessible");
390
- }
391
- return {
392
- valid: issues.length === 0,
393
- issues
394
- };
395
- }
396
- }
397
- async function detectSmartDefaults() {
398
- const detector = new SmartDefaultsDetector();
399
- return detector.detect();
400
- }
401
- function detectCodeToolType() {
402
- return SmartDefaultsDetector.detectCodeToolType();
403
- }
404
-
405
- const smartDefaults = {
406
- __proto__: null,
407
- SmartDefaultsDetector: SmartDefaultsDetector,
408
- detectCodeToolType: detectCodeToolType,
409
- detectSmartDefaults: detectSmartDefaults
410
- };
411
-
412
- export { detectCodeToolType as a, detectSmartDefaults as d, parseOrchestrationLevel as p, smartDefaults as s, writeOrchestrationPolicy as w };