ccjk 14.2.2 → 15.1.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 (532) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +75 -338
  3. package/dist/cli.js +89 -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 +165 -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 +42 -0
  16. package/dist/commands/menu.js.map +1 -0
  17. package/dist/commands/profile.js +138 -0
  18. package/dist/commands/profile.js.map +1 -0
  19. package/dist/core/detect.js +24 -0
  20. package/dist/core/detect.js.map +1 -0
  21. package/dist/core/lint.js +49 -0
  22. package/dist/core/lint.js.map +1 -0
  23. package/dist/core/mcp.js +41 -0
  24. package/dist/core/mcp.js.map +1 -0
  25. package/dist/core/paths.js +9 -0
  26. package/dist/core/paths.js.map +1 -0
  27. package/dist/core/profiles.js +104 -0
  28. package/dist/core/profiles.js.map +1 -0
  29. package/dist/core/providers.js +53 -0
  30. package/dist/core/providers.js.map +1 -0
  31. package/dist/core/settings.js +31 -0
  32. package/dist/core/settings.js.map +1 -0
  33. package/dist/core/slash-templates.js +56 -0
  34. package/dist/core/slash-templates.js.map +1 -0
  35. package/dist/core/tools.js +27 -0
  36. package/dist/core/tools.js.map +1 -0
  37. package/package.json +43 -164
  38. package/README.HONEST.md +0 -176
  39. package/README.en.md +0 -67
  40. package/README.ja.md +0 -67
  41. package/README.ko.md +0 -67
  42. package/README.zh-CN.md +0 -86
  43. package/bin/ccjk.mjs +0 -5
  44. package/bin/ccjk.ts +0 -222
  45. package/dist/chunks/agent-teams.mjs +0 -145
  46. package/dist/chunks/agent.mjs +0 -1439
  47. package/dist/chunks/agents.mjs +0 -3783
  48. package/dist/chunks/api-cli.mjs +0 -135
  49. package/dist/chunks/api-config-selector.mjs +0 -159
  50. package/dist/chunks/api-providers.mjs +0 -144
  51. package/dist/chunks/api.mjs +0 -115
  52. package/dist/chunks/auto-bootstrap.mjs +0 -358
  53. package/dist/chunks/auto-fixer.mjs +0 -95
  54. package/dist/chunks/auto-updater.mjs +0 -507
  55. package/dist/chunks/banner.mjs +0 -173
  56. package/dist/chunks/bash.mjs +0 -187
  57. package/dist/chunks/boost.mjs +0 -474
  58. package/dist/chunks/brain-config.mjs +0 -75
  59. package/dist/chunks/brain-status.mjs +0 -89
  60. package/dist/chunks/ccjk-agents.mjs +0 -416
  61. package/dist/chunks/ccjk-all.mjs +0 -1046
  62. package/dist/chunks/ccjk-config.mjs +0 -445
  63. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  64. package/dist/chunks/ccjk-mcp.mjs +0 -763
  65. package/dist/chunks/ccjk-setup.mjs +0 -765
  66. package/dist/chunks/ccjk-skills.mjs +0 -518
  67. package/dist/chunks/ccr.mjs +0 -109
  68. package/dist/chunks/ccu.mjs +0 -40
  69. package/dist/chunks/check-updates.mjs +0 -117
  70. package/dist/chunks/claude-code-incremental-manager.mjs +0 -761
  71. package/dist/chunks/claude-config.mjs +0 -606
  72. package/dist/chunks/claude-config2.mjs +0 -62
  73. package/dist/chunks/claude-wrapper.mjs +0 -85
  74. package/dist/chunks/clavue-config.mjs +0 -1454
  75. package/dist/chunks/cleanup-migration.mjs +0 -20
  76. package/dist/chunks/cli-hook.mjs +0 -4096
  77. package/dist/chunks/cloud-sync.mjs +0 -29
  78. package/dist/chunks/code-type-resolver.mjs +0 -880
  79. package/dist/chunks/codex-config-switch.mjs +0 -452
  80. package/dist/chunks/codex-provider-manager.mjs +0 -238
  81. package/dist/chunks/codex-uninstaller.mjs +0 -404
  82. package/dist/chunks/codex.mjs +0 -2141
  83. package/dist/chunks/commands.mjs +0 -108
  84. package/dist/chunks/commands2.mjs +0 -421
  85. package/dist/chunks/commit.mjs +0 -140
  86. package/dist/chunks/completion.mjs +0 -517
  87. package/dist/chunks/config-consolidator.mjs +0 -172
  88. package/dist/chunks/config-switch.mjs +0 -334
  89. package/dist/chunks/config.mjs +0 -558
  90. package/dist/chunks/config2.mjs +0 -484
  91. package/dist/chunks/config3.mjs +0 -486
  92. package/dist/chunks/constants.mjs +0 -323
  93. package/dist/chunks/context-opt.mjs +0 -444
  94. package/dist/chunks/context.mjs +0 -974
  95. package/dist/chunks/dashboard.mjs +0 -481
  96. package/dist/chunks/doctor.mjs +0 -1301
  97. package/dist/chunks/eval.mjs +0 -502
  98. package/dist/chunks/evolution.mjs +0 -322
  99. package/dist/chunks/features.mjs +0 -715
  100. package/dist/chunks/fish.mjs +0 -181
  101. package/dist/chunks/fs-operations.mjs +0 -180
  102. package/dist/chunks/health-alerts.mjs +0 -830
  103. package/dist/chunks/help.mjs +0 -341
  104. package/dist/chunks/hook-installer.mjs +0 -48
  105. package/dist/chunks/impact.mjs +0 -651
  106. package/dist/chunks/index.mjs +0 -23
  107. package/dist/chunks/index10.mjs +0 -19
  108. package/dist/chunks/index11.mjs +0 -1171
  109. package/dist/chunks/index12.mjs +0 -218
  110. package/dist/chunks/index13.mjs +0 -679
  111. package/dist/chunks/index14.mjs +0 -1009
  112. package/dist/chunks/index15.mjs +0 -194
  113. package/dist/chunks/index2.mjs +0 -7637
  114. package/dist/chunks/index3.mjs +0 -171
  115. package/dist/chunks/index4.mjs +0 -26
  116. package/dist/chunks/index5.mjs +0 -19
  117. package/dist/chunks/index6.mjs +0 -19092
  118. package/dist/chunks/index7.mjs +0 -616
  119. package/dist/chunks/index8.mjs +0 -1602
  120. package/dist/chunks/index9.mjs +0 -5384
  121. package/dist/chunks/init.mjs +0 -1911
  122. package/dist/chunks/installer.mjs +0 -757
  123. package/dist/chunks/installer2.mjs +0 -103
  124. package/dist/chunks/interview.mjs +0 -2927
  125. package/dist/chunks/json-config.mjs +0 -60
  126. package/dist/chunks/linux.mjs +0 -3863
  127. package/dist/chunks/macos.mjs +0 -69
  128. package/dist/chunks/main.mjs +0 -635
  129. package/dist/chunks/manager.mjs +0 -1048
  130. package/dist/chunks/marketplace.mjs +0 -265
  131. package/dist/chunks/mcp-cli.mjs +0 -205
  132. package/dist/chunks/mcp-performance.mjs +0 -187
  133. package/dist/chunks/mcp.mjs +0 -667
  134. package/dist/chunks/memory-check.mjs +0 -2973
  135. package/dist/chunks/memory-paths.mjs +0 -259
  136. package/dist/chunks/memory-sync.mjs +0 -209
  137. package/dist/chunks/memory.mjs +0 -354
  138. package/dist/chunks/metrics-display.mjs +0 -153
  139. package/dist/chunks/monitor.mjs +0 -1856
  140. package/dist/chunks/notification.mjs +0 -1864
  141. package/dist/chunks/onboarding.mjs +0 -386
  142. package/dist/chunks/package.mjs +0 -3
  143. package/dist/chunks/paradigm.mjs +0 -74
  144. package/dist/chunks/permission-manager.mjs +0 -250
  145. package/dist/chunks/permissions.mjs +0 -265
  146. package/dist/chunks/persistence-manager.mjs +0 -801
  147. package/dist/chunks/persistence.mjs +0 -707
  148. package/dist/chunks/platform.mjs +0 -395
  149. package/dist/chunks/plugin.mjs +0 -1936
  150. package/dist/chunks/powershell.mjs +0 -213
  151. package/dist/chunks/prompts.mjs +0 -244
  152. package/dist/chunks/providers.mjs +0 -263
  153. package/dist/chunks/quick-actions.mjs +0 -335
  154. package/dist/chunks/quick-provider.mjs +0 -755
  155. package/dist/chunks/quick-setup.mjs +0 -421
  156. package/dist/chunks/remote.mjs +0 -497
  157. package/dist/chunks/research.mjs +0 -1904
  158. package/dist/chunks/rollback.mjs +0 -38
  159. package/dist/chunks/session-manager.mjs +0 -1371
  160. package/dist/chunks/session.mjs +0 -878
  161. package/dist/chunks/sessions.mjs +0 -106
  162. package/dist/chunks/silent-updater.mjs +0 -396
  163. package/dist/chunks/simple-config.mjs +0 -122
  164. package/dist/chunks/skill.mjs +0 -117
  165. package/dist/chunks/skill2.mjs +0 -9052
  166. package/dist/chunks/skills-sync.mjs +0 -1343
  167. package/dist/chunks/skills.mjs +0 -577
  168. package/dist/chunks/slash-commands.mjs +0 -208
  169. package/dist/chunks/smart-guide.mjs +0 -247
  170. package/dist/chunks/snapshot.mjs +0 -58
  171. package/dist/chunks/startup.mjs +0 -487
  172. package/dist/chunks/stats.mjs +0 -191
  173. package/dist/chunks/status.mjs +0 -471
  174. package/dist/chunks/team.mjs +0 -63
  175. package/dist/chunks/thinking.mjs +0 -626
  176. package/dist/chunks/trace.mjs +0 -57
  177. package/dist/chunks/uninstall.mjs +0 -852
  178. package/dist/chunks/update.mjs +0 -174
  179. package/dist/chunks/upgrade-manager.mjs +0 -204
  180. package/dist/chunks/upgrade.mjs +0 -133
  181. package/dist/chunks/version-checker.mjs +0 -891
  182. package/dist/chunks/vim.mjs +0 -903
  183. package/dist/chunks/windows.mjs +0 -14
  184. package/dist/chunks/workflows.mjs +0 -633
  185. package/dist/chunks/wsl.mjs +0 -129
  186. package/dist/chunks/zero-config.mjs +0 -871
  187. package/dist/chunks/zsh.mjs +0 -182
  188. package/dist/cli.d.mts +0 -1
  189. package/dist/cli.d.ts +0 -1
  190. package/dist/cli.mjs +0 -2684
  191. package/dist/i18n/locales/en/agent-teams.json +0 -18
  192. package/dist/i18n/locales/en/agentBrowser.json +0 -80
  193. package/dist/i18n/locales/en/agents.json +0 -135
  194. package/dist/i18n/locales/en/api.json +0 -63
  195. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  196. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  197. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  198. package/dist/i18n/locales/en/ccjk.json +0 -276
  199. package/dist/i18n/locales/en/ccr.json +0 -65
  200. package/dist/i18n/locales/en/claude-md.json +0 -73
  201. package/dist/i18n/locales/en/cli.json +0 -148
  202. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  203. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  204. package/dist/i18n/locales/en/cloud.json +0 -40
  205. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  206. package/dist/i18n/locales/en/codex.json +0 -184
  207. package/dist/i18n/locales/en/cometix.json +0 -29
  208. package/dist/i18n/locales/en/common.json +0 -68
  209. package/dist/i18n/locales/en/config.json +0 -108
  210. package/dist/i18n/locales/en/configuration.json +0 -236
  211. package/dist/i18n/locales/en/context.json +0 -85
  212. package/dist/i18n/locales/en/dashboard.json +0 -78
  213. package/dist/i18n/locales/en/errors.json +0 -26
  214. package/dist/i18n/locales/en/evolution.json +0 -54
  215. package/dist/i18n/locales/en/hooks.json +0 -74
  216. package/dist/i18n/locales/en/hooksSync.json +0 -133
  217. package/dist/i18n/locales/en/installation.json +0 -83
  218. package/dist/i18n/locales/en/interview.json +0 -104
  219. package/dist/i18n/locales/en/language.json +0 -19
  220. package/dist/i18n/locales/en/lsp.json +0 -78
  221. package/dist/i18n/locales/en/marketplace.json +0 -116
  222. package/dist/i18n/locales/en/mcp.json +0 -180
  223. package/dist/i18n/locales/en/memory.json +0 -23
  224. package/dist/i18n/locales/en/menu.json +0 -299
  225. package/dist/i18n/locales/en/multi-config.json +0 -79
  226. package/dist/i18n/locales/en/notification.json +0 -307
  227. package/dist/i18n/locales/en/permissions.json +0 -95
  228. package/dist/i18n/locales/en/persistence.json +0 -127
  229. package/dist/i18n/locales/en/plugins.json +0 -146
  230. package/dist/i18n/locales/en/quick-actions.json +0 -78
  231. package/dist/i18n/locales/en/registry.json +0 -54
  232. package/dist/i18n/locales/en/remote.json +0 -93
  233. package/dist/i18n/locales/en/sandbox.json +0 -44
  234. package/dist/i18n/locales/en/setup.json +0 -44
  235. package/dist/i18n/locales/en/shencha.json +0 -14
  236. package/dist/i18n/locales/en/skills.json +0 -100
  237. package/dist/i18n/locales/en/skillsSync.json +0 -74
  238. package/dist/i18n/locales/en/smartGuide.json +0 -49
  239. package/dist/i18n/locales/en/stats.json +0 -20
  240. package/dist/i18n/locales/en/subagent.json +0 -69
  241. package/dist/i18n/locales/en/superpowers.json +0 -117
  242. package/dist/i18n/locales/en/team.json +0 -7
  243. package/dist/i18n/locales/en/thinking.json +0 -65
  244. package/dist/i18n/locales/en/tools.json +0 -42
  245. package/dist/i18n/locales/en/uninstall.json +0 -56
  246. package/dist/i18n/locales/en/updater.json +0 -29
  247. package/dist/i18n/locales/en/vim.json +0 -169
  248. package/dist/i18n/locales/en/workflow.json +0 -55
  249. package/dist/i18n/locales/en/workspace.json +0 -108
  250. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  251. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -80
  252. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  253. package/dist/i18n/locales/zh-CN/api.json +0 -63
  254. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  255. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  256. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  257. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  258. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  259. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  260. package/dist/i18n/locales/zh-CN/cli.json +0 -148
  261. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  262. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  263. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  264. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  265. package/dist/i18n/locales/zh-CN/codex.json +0 -184
  266. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  267. package/dist/i18n/locales/zh-CN/common.json +0 -68
  268. package/dist/i18n/locales/zh-CN/config.json +0 -108
  269. package/dist/i18n/locales/zh-CN/configuration.json +0 -234
  270. package/dist/i18n/locales/zh-CN/context.json +0 -85
  271. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  272. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  273. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  274. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  275. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  276. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  277. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  278. package/dist/i18n/locales/zh-CN/language.json +0 -19
  279. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  280. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  281. package/dist/i18n/locales/zh-CN/mcp.json +0 -180
  282. package/dist/i18n/locales/zh-CN/memory.json +0 -23
  283. package/dist/i18n/locales/zh-CN/menu.json +0 -299
  284. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  285. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  286. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  287. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  288. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  289. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  290. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  291. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  292. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  293. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  294. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  295. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  296. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  297. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  298. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  299. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  300. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  301. package/dist/i18n/locales/zh-CN/team.json +0 -7
  302. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  303. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  304. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  305. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  306. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  307. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  308. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  309. package/dist/index.d.mts +0 -5658
  310. package/dist/index.d.ts +0 -5658
  311. package/dist/index.mjs +0 -3732
  312. package/dist/shared/ccjk.5bEolFrk.mjs +0 -254
  313. package/dist/shared/ccjk.8oaxX4iR.mjs +0 -90
  314. package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
  315. package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
  316. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  317. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  318. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  319. package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
  320. package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
  321. package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
  322. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  323. package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
  324. package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
  325. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  326. package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
  327. package/dist/shared/ccjk.C0WLUnFV.mjs +0 -293
  328. package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
  329. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  330. package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
  331. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  332. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  333. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  334. package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
  335. package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
  336. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  337. package/dist/shared/ccjk.D-magaEx.mjs +0 -763
  338. package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
  339. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  340. package/dist/shared/ccjk.D75wivnp.mjs +0 -142
  341. package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
  342. package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
  343. package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
  344. package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
  345. package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
  346. package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
  347. package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
  348. package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
  349. package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
  350. package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
  351. package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
  352. package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
  353. package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
  354. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  355. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  356. package/dist/shared/ccjk.L7yC58_i.mjs +0 -225
  357. package/dist/shared/ccjk.MwtjAULc.mjs +0 -1447
  358. package/dist/shared/ccjk.OJKHVSOb.mjs +0 -2005
  359. package/dist/shared/ccjk.OTnevPNE.mjs +0 -225
  360. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  361. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  362. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  363. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  364. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  365. package/dist/shared/ccjk.i_vn-9C3.mjs +0 -317
  366. package/dist/shared/ccjk.lG3ccFjm.mjs +0 -885
  367. package/dist/shared/ccjk.wLJHO0Af.mjs +0 -244
  368. package/dist/shared/ccjk.y-a_1vK4.mjs +0 -5127
  369. package/dist/templates/agents/README.md +0 -78
  370. package/dist/templates/agents/fullstack-developer.json +0 -70
  371. package/dist/templates/agents/go-expert.json +0 -69
  372. package/dist/templates/agents/index.json +0 -64
  373. package/dist/templates/agents/python-expert.json +0 -69
  374. package/dist/templates/agents/react-specialist.json +0 -69
  375. package/dist/templates/agents/testing-automation-expert.json +0 -70
  376. package/dist/templates/agents/typescript-architect.json +0 -69
  377. package/dist/templates/claude-code/common/settings.json +0 -109
  378. package/dist/templates/common/error-prevention.md +0 -267
  379. package/dist/templates/common/karpathy-baseline.md +0 -83
  380. package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  381. package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  382. package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  383. package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  384. package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  385. package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  386. package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  387. package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  388. package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  389. package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  390. package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  391. package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  392. package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  393. package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  394. package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  395. package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  396. package/dist/templates/common/workflow/essential/en/feat.md +0 -92
  397. package/dist/templates/common/workflow/essential/en/goal.md +0 -147
  398. package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
  399. package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  400. package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  401. package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  402. package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  403. package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  404. package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  405. package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  406. package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
  407. package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
  408. package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
  409. package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  410. package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  411. package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  412. package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  413. package/dist/templates/common/workflow/interview/en/interview.md +0 -67
  414. package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  415. package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  416. package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  417. package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  418. package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  419. package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
  420. package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  421. package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  422. package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  423. package/dist/templates/hooks/README.md +0 -212
  424. package/dist/templates/hooks/git-workflow-hooks.md +0 -551
  425. package/dist/templates/hooks/post-test/coverage.json +0 -21
  426. package/dist/templates/hooks/post-test/summary.json +0 -21
  427. package/dist/templates/hooks/post-test-coverage.md +0 -434
  428. package/dist/templates/hooks/pre-commit/eslint.json +0 -22
  429. package/dist/templates/hooks/pre-commit/prettier.json +0 -22
  430. package/dist/templates/hooks/pre-commit-black.md +0 -274
  431. package/dist/templates/hooks/pre-commit-eslint.md +0 -153
  432. package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
  433. package/dist/templates/hooks/pre-commit-prettier.md +0 -212
  434. package/dist/templates/hooks/pre-commit-type-check.md +0 -377
  435. package/dist/templates/skills/ccjk-init.md +0 -154
  436. package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
  437. package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
  438. package/dist/templates/skills/django-patterns.md +0 -1016
  439. package/dist/templates/skills/git-workflow.md +0 -748
  440. package/dist/templates/skills/go-idioms.md +0 -963
  441. package/dist/templates/skills/index.json +0 -132
  442. package/dist/templates/skills/nextjs-optimization.md +0 -694
  443. package/dist/templates/skills/python-pep8.md +0 -852
  444. package/dist/templates/skills/react-patterns.md +0 -686
  445. package/dist/templates/skills/rust-patterns.md +0 -1057
  446. package/dist/templates/skills/security-best-practices.md +0 -1413
  447. package/dist/templates/skills/testing-best-practices.md +0 -1315
  448. package/dist/templates/skills/ts-best-practices.md +0 -354
  449. package/templates/agents/README.md +0 -78
  450. package/templates/agents/fullstack-developer.json +0 -70
  451. package/templates/agents/go-expert.json +0 -69
  452. package/templates/agents/index.json +0 -64
  453. package/templates/agents/python-expert.json +0 -69
  454. package/templates/agents/react-specialist.json +0 -69
  455. package/templates/agents/testing-automation-expert.json +0 -70
  456. package/templates/agents/typescript-architect.json +0 -69
  457. package/templates/claude-code/common/settings.json +0 -109
  458. package/templates/common/error-prevention.md +0 -267
  459. package/templates/common/karpathy-baseline.md +0 -83
  460. package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  461. package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  462. package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  463. package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  464. package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  465. package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  466. package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  467. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  468. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  469. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  470. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  471. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  472. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  473. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  474. package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  475. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  476. package/templates/common/workflow/essential/en/feat.md +0 -92
  477. package/templates/common/workflow/essential/en/goal.md +0 -147
  478. package/templates/common/workflow/essential/en/init-project.md +0 -53
  479. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  480. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  481. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  482. package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  483. package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  484. package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  485. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  486. package/templates/common/workflow/git/en/git-commit.md +0 -205
  487. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  488. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  489. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  490. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  491. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  492. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  493. package/templates/common/workflow/interview/en/interview.md +0 -67
  494. package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  495. package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  496. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  497. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  498. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  499. package/templates/common/workflow/sixStep/en/workflow.md +0 -83
  500. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  501. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  502. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  503. package/templates/hooks/README.md +0 -212
  504. package/templates/hooks/git-workflow-hooks.md +0 -551
  505. package/templates/hooks/post-test/coverage.json +0 -21
  506. package/templates/hooks/post-test/summary.json +0 -21
  507. package/templates/hooks/post-test-coverage.md +0 -434
  508. package/templates/hooks/pre-commit/eslint.json +0 -22
  509. package/templates/hooks/pre-commit/prettier.json +0 -22
  510. package/templates/hooks/pre-commit-black.md +0 -274
  511. package/templates/hooks/pre-commit-eslint.md +0 -153
  512. package/templates/hooks/pre-commit-gofmt.md +0 -284
  513. package/templates/hooks/pre-commit-prettier.md +0 -212
  514. package/templates/hooks/pre-commit-type-check.md +0 -377
  515. package/templates/skills/basic.hbs +0 -72
  516. package/templates/skills/ccjk-init.md +0 -154
  517. package/templates/skills/ccjk-mcp-setup.md +0 -205
  518. package/templates/skills/ccjk-troubleshoot.md +0 -228
  519. package/templates/skills/code-refactor.hbs +0 -133
  520. package/templates/skills/code-review.hbs +0 -141
  521. package/templates/skills/django-patterns.md +0 -1016
  522. package/templates/skills/git-workflow.md +0 -748
  523. package/templates/skills/go-idioms.md +0 -963
  524. package/templates/skills/index.json +0 -132
  525. package/templates/skills/nextjs-optimization.md +0 -694
  526. package/templates/skills/python-pep8.md +0 -852
  527. package/templates/skills/react-patterns.md +0 -686
  528. package/templates/skills/rust-patterns.md +0 -1057
  529. package/templates/skills/security-best-practices.md +0 -1413
  530. package/templates/skills/testing-best-practices.md +0 -1315
  531. package/templates/skills/ts-best-practices.md +0 -354
  532. package/templates/skills/type-fix.hbs +0 -132
@@ -1,1439 +0,0 @@
1
- import a from './index5.mjs';
2
- import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'node:fs';
3
- import { CCJK_CONFIG_DIR } from './constants.mjs';
4
- import { w as writeAgentFile } from '../shared/ccjk.CfKKcvWy.mjs';
5
- import { g as getPluginManager } from '../shared/ccjk.MwtjAULc.mjs';
6
- import { homedir } from 'node:os';
7
- import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
8
- import '../shared/ccjk.BAGoDD49.mjs';
9
- import './index2.mjs';
10
- import 'node:process';
11
- import 'node:url';
12
- import './main.mjs';
13
- import 'module';
14
- import 'node:child_process';
15
- import 'node:path';
16
- import 'node:stream';
17
- import 'node:readline';
18
- import '../shared/ccjk.i_vn-9C3.mjs';
19
-
20
- const CLAUDE_CONFIG_PATH = join(homedir(), ".claude.json");
21
- const TOOL_CACHE_TTL = 5 * 60 * 1e3;
22
- class McpServerManager {
23
- servers = /* @__PURE__ */ new Map();
24
- toolCache = /* @__PURE__ */ new Map();
25
- configPath;
26
- initialized = false;
27
- constructor(configPath = CLAUDE_CONFIG_PATH) {
28
- this.configPath = configPath;
29
- }
30
- // ==========================================================================
31
- // Initialization
32
- // ==========================================================================
33
- /**
34
- * Initialize the manager by loading MCP configuration
35
- */
36
- async initialize() {
37
- if (this.initialized) {
38
- return;
39
- }
40
- await this.loadConfiguration();
41
- this.initialized = true;
42
- }
43
- /**
44
- * Load MCP configuration from file
45
- */
46
- async loadConfiguration() {
47
- const config = this.readConfigFile();
48
- if (!config?.mcpServers) {
49
- return;
50
- }
51
- for (const [name, serverConfig] of Object.entries(config.mcpServers)) {
52
- this.servers.set(name, {
53
- name,
54
- config: serverConfig,
55
- status: "unknown"
56
- });
57
- }
58
- }
59
- /**
60
- * Read the Claude configuration file
61
- */
62
- readConfigFile() {
63
- if (!existsSync(this.configPath)) {
64
- return null;
65
- }
66
- try {
67
- const content = readFileSync(this.configPath, "utf-8");
68
- return JSON.parse(content);
69
- } catch (error) {
70
- console.error(`Failed to read MCP config from ${this.configPath}:`, error);
71
- return null;
72
- }
73
- }
74
- /**
75
- * Reload configuration (useful after config changes)
76
- */
77
- async reload() {
78
- this.servers.clear();
79
- this.toolCache.clear();
80
- this.initialized = false;
81
- await this.initialize();
82
- }
83
- // ==========================================================================
84
- // Server Management
85
- // ==========================================================================
86
- /**
87
- * Get all configured MCP servers
88
- */
89
- getServers() {
90
- return Array.from(this.servers.values());
91
- }
92
- /**
93
- * Get a specific server by name
94
- */
95
- getServer(name) {
96
- return this.servers.get(name);
97
- }
98
- /**
99
- * Get server names
100
- */
101
- getServerNames() {
102
- return Array.from(this.servers.keys());
103
- }
104
- /**
105
- * Check if a server is configured
106
- */
107
- hasServer(name) {
108
- return this.servers.has(name);
109
- }
110
- // ==========================================================================
111
- // Tool Discovery
112
- // ==========================================================================
113
- /**
114
- * Get available tools from a specific MCP server
115
- *
116
- * This method attempts to discover tools by querying the MCP server.
117
- * Results are cached to avoid repeated queries.
118
- */
119
- async getServerTools(serverName) {
120
- const server = this.servers.get(serverName);
121
- if (!server) {
122
- return [];
123
- }
124
- const cached = this.toolCache.get(serverName);
125
- if (cached && Date.now() - cached.timestamp < TOOL_CACHE_TTL) {
126
- return cached.tools;
127
- }
128
- const tools = await this.discoverTools(server);
129
- this.toolCache.set(serverName, {
130
- tools,
131
- timestamp: Date.now()
132
- });
133
- server.tools = tools;
134
- server.lastUpdated = Date.now();
135
- return tools;
136
- }
137
- /**
138
- * Get all available tools from all configured servers
139
- */
140
- async getAllTools() {
141
- const allTools = [];
142
- for (const serverName of this.servers.keys()) {
143
- const tools = await this.getServerTools(serverName);
144
- allTools.push(...tools);
145
- }
146
- return allTools;
147
- }
148
- /**
149
- * Get tools for specific servers (used by AgentRuntime)
150
- *
151
- * @param mcpRefs - Array of MCP server references from agent definition
152
- */
153
- async getToolsForAgent(mcpRefs) {
154
- const tools = [];
155
- for (const ref of mcpRefs) {
156
- const serverTools = await this.getServerTools(ref.serverName);
157
- if (ref.tools && ref.tools.length > 0) {
158
- const filteredTools = serverTools.filter((t) => ref.tools.includes(t.name));
159
- tools.push(...filteredTools);
160
- } else {
161
- tools.push(...serverTools);
162
- }
163
- }
164
- return tools;
165
- }
166
- /**
167
- * Discover tools from an MCP server
168
- *
169
- * This is a simplified implementation that returns predefined tools
170
- * based on known MCP server types. In a full implementation, this would
171
- * actually connect to the MCP server and query its capabilities.
172
- */
173
- async discoverTools(server) {
174
- const tools = [];
175
- try {
176
- if (server.config.type === "stdio" && server.config.command) {
177
- const discoveredTools = await this.queryStdioServerTools(server);
178
- if (discoveredTools.length > 0) {
179
- server.status = "connected";
180
- return discoveredTools;
181
- }
182
- }
183
- if (server.config.type === "sse" && server.config.url) {
184
- const discoveredTools = await this.querySseServerTools(server);
185
- if (discoveredTools.length > 0) {
186
- server.status = "connected";
187
- return discoveredTools;
188
- }
189
- }
190
- const knownTools = this.getKnownServerTools(server.name, server.config);
191
- if (knownTools.length > 0) {
192
- server.status = "unknown";
193
- return knownTools;
194
- }
195
- server.status = "unknown";
196
- return tools;
197
- } catch (error) {
198
- server.status = "error";
199
- server.error = error instanceof Error ? error.message : String(error);
200
- return tools;
201
- }
202
- }
203
- /**
204
- * Query tools from a stdio-based MCP server
205
- *
206
- * Note: This is a placeholder implementation. Real MCP tool discovery
207
- * would require implementing the MCP protocol handshake.
208
- */
209
- async queryStdioServerTools(_server) {
210
- return [];
211
- }
212
- /**
213
- * Query tools from an SSE-based MCP server
214
- *
215
- * Note: This is a placeholder implementation.
216
- */
217
- async querySseServerTools(_server) {
218
- return [];
219
- }
220
- /**
221
- * Get known tools for common MCP servers
222
- *
223
- * This provides tool information for well-known MCP servers
224
- * without needing to actually connect to them.
225
- */
226
- getKnownServerTools(serverName, config) {
227
- const tools = [];
228
- const command = config.command || "";
229
- const args = config.args?.join(" ") || "";
230
- const identifier = `${serverName} ${command} ${args}`.toLowerCase();
231
- if (identifier.includes("filesystem") || identifier.includes("fs")) {
232
- tools.push(
233
- {
234
- server: serverName,
235
- name: "read_file",
236
- description: "Read the contents of a file",
237
- inputSchema: {
238
- type: "object",
239
- properties: {
240
- path: { type: "string", description: "Path to the file to read" }
241
- },
242
- required: ["path"]
243
- }
244
- },
245
- {
246
- server: serverName,
247
- name: "write_file",
248
- description: "Write content to a file",
249
- inputSchema: {
250
- type: "object",
251
- properties: {
252
- path: { type: "string", description: "Path to the file to write" },
253
- content: { type: "string", description: "Content to write" }
254
- },
255
- required: ["path", "content"]
256
- }
257
- },
258
- {
259
- server: serverName,
260
- name: "list_directory",
261
- description: "List contents of a directory",
262
- inputSchema: {
263
- type: "object",
264
- properties: {
265
- path: { type: "string", description: "Path to the directory" }
266
- },
267
- required: ["path"]
268
- }
269
- }
270
- );
271
- }
272
- if (identifier.includes("exa")) {
273
- tools.push(
274
- {
275
- server: serverName,
276
- name: "web_search",
277
- description: "Search the web using Exa",
278
- inputSchema: {
279
- type: "object",
280
- properties: {
281
- query: { type: "string", description: "Search query" },
282
- numResults: { type: "number", description: "Number of results to return" }
283
- },
284
- required: ["query"]
285
- }
286
- },
287
- {
288
- server: serverName,
289
- name: "find_similar",
290
- description: "Find similar content to a URL",
291
- inputSchema: {
292
- type: "object",
293
- properties: {
294
- url: { type: "string", description: "URL to find similar content for" }
295
- },
296
- required: ["url"]
297
- }
298
- }
299
- );
300
- }
301
- if (identifier.includes("github")) {
302
- tools.push(
303
- {
304
- server: serverName,
305
- name: "search_repositories",
306
- description: "Search GitHub repositories",
307
- inputSchema: {
308
- type: "object",
309
- properties: {
310
- query: { type: "string", description: "Search query" }
311
- },
312
- required: ["query"]
313
- }
314
- },
315
- {
316
- server: serverName,
317
- name: "get_file_contents",
318
- description: "Get contents of a file from a repository",
319
- inputSchema: {
320
- type: "object",
321
- properties: {
322
- owner: { type: "string", description: "Repository owner" },
323
- repo: { type: "string", description: "Repository name" },
324
- path: { type: "string", description: "File path" }
325
- },
326
- required: ["owner", "repo", "path"]
327
- }
328
- },
329
- {
330
- server: serverName,
331
- name: "create_issue",
332
- description: "Create a new issue in a repository",
333
- inputSchema: {
334
- type: "object",
335
- properties: {
336
- owner: { type: "string", description: "Repository owner" },
337
- repo: { type: "string", description: "Repository name" },
338
- title: { type: "string", description: "Issue title" },
339
- body: { type: "string", description: "Issue body" }
340
- },
341
- required: ["owner", "repo", "title"]
342
- }
343
- }
344
- );
345
- }
346
- if (identifier.includes("playwright")) {
347
- tools.push(
348
- {
349
- server: serverName,
350
- name: "browser_navigate",
351
- description: "Navigate to a URL",
352
- inputSchema: {
353
- type: "object",
354
- properties: {
355
- url: { type: "string", description: "URL to navigate to" }
356
- },
357
- required: ["url"]
358
- }
359
- },
360
- {
361
- server: serverName,
362
- name: "browser_snapshot",
363
- description: "Take an accessibility snapshot of the page",
364
- inputSchema: {
365
- type: "object",
366
- properties: {}
367
- }
368
- },
369
- {
370
- server: serverName,
371
- name: "browser_click",
372
- description: "Click on an element",
373
- inputSchema: {
374
- type: "object",
375
- properties: {
376
- element: { type: "string", description: "Element description" },
377
- ref: { type: "string", description: "Element reference" }
378
- },
379
- required: ["element", "ref"]
380
- }
381
- }
382
- );
383
- }
384
- if (identifier.includes("context7")) {
385
- tools.push(
386
- {
387
- server: serverName,
388
- name: "resolve-library-id",
389
- description: "Resolve a library name to Context7 library ID",
390
- inputSchema: {
391
- type: "object",
392
- properties: {
393
- libraryName: { type: "string", description: "Library name to search for" }
394
- },
395
- required: ["libraryName"]
396
- }
397
- },
398
- {
399
- server: serverName,
400
- name: "query-docs",
401
- description: "Query documentation for a library",
402
- inputSchema: {
403
- type: "object",
404
- properties: {
405
- libraryId: { type: "string", description: "Context7 library ID" },
406
- query: { type: "string", description: "Query string" }
407
- },
408
- required: ["libraryId", "query"]
409
- }
410
- }
411
- );
412
- }
413
- if (identifier.includes("fetch") || identifier.includes("http")) {
414
- tools.push({
415
- server: serverName,
416
- name: "fetch",
417
- description: "Fetch content from a URL",
418
- inputSchema: {
419
- type: "object",
420
- properties: {
421
- url: { type: "string", description: "URL to fetch" },
422
- method: { type: "string", description: "HTTP method", enum: ["GET", "POST", "PUT", "DELETE"] },
423
- headers: { type: "object", description: "Request headers" },
424
- body: { type: "string", description: "Request body" }
425
- },
426
- required: ["url"]
427
- }
428
- });
429
- }
430
- if (identifier.includes("memory") || identifier.includes("knowledge")) {
431
- tools.push(
432
- {
433
- server: serverName,
434
- name: "store_memory",
435
- description: "Store information in memory",
436
- inputSchema: {
437
- type: "object",
438
- properties: {
439
- key: { type: "string", description: "Memory key" },
440
- value: { type: "string", description: "Value to store" }
441
- },
442
- required: ["key", "value"]
443
- }
444
- },
445
- {
446
- server: serverName,
447
- name: "retrieve_memory",
448
- description: "Retrieve information from memory",
449
- inputSchema: {
450
- type: "object",
451
- properties: {
452
- key: { type: "string", description: "Memory key" }
453
- },
454
- required: ["key"]
455
- }
456
- }
457
- );
458
- }
459
- return tools;
460
- }
461
- // ==========================================================================
462
- // Tool Execution (Optional Proxy)
463
- // ==========================================================================
464
- /**
465
- * Execute a tool call through the MCP server
466
- *
467
- * Note: This is a placeholder for future implementation.
468
- * In a full implementation, this would:
469
- * 1. Connect to the appropriate MCP server
470
- * 2. Send the tool call request
471
- * 3. Return the response
472
- *
473
- * For now, agents should use Claude Code's native MCP integration.
474
- */
475
- async callTool(request) {
476
- const server = this.servers.get(request.server);
477
- if (!server) {
478
- return {
479
- success: false,
480
- error: `Server not found: ${request.server}`
481
- };
482
- }
483
- const startTime = Date.now();
484
- try {
485
- return {
486
- success: false,
487
- error: "Direct tool execution not yet implemented. Use Claude Code's native MCP integration.",
488
- duration: Date.now() - startTime
489
- };
490
- } catch (error) {
491
- return {
492
- success: false,
493
- error: error instanceof Error ? error.message : String(error),
494
- duration: Date.now() - startTime
495
- };
496
- }
497
- }
498
- // ==========================================================================
499
- // Utility Methods
500
- // ==========================================================================
501
- /**
502
- * Get tool information formatted for agent system prompt
503
- */
504
- formatToolsForPrompt(tools) {
505
- if (tools.length === 0) {
506
- return "";
507
- }
508
- const lines = ["## Available MCP Tools", ""];
509
- const byServer = /* @__PURE__ */ new Map();
510
- for (const tool of tools) {
511
- const serverTools = byServer.get(tool.server) || [];
512
- serverTools.push(tool);
513
- byServer.set(tool.server, serverTools);
514
- }
515
- for (const [server, serverTools] of byServer) {
516
- lines.push(`### ${server}`);
517
- lines.push("");
518
- for (const tool of serverTools) {
519
- lines.push(`**${tool.name}**: ${tool.description}`);
520
- const schema = tool.inputSchema;
521
- if (schema.properties) {
522
- const params = Object.entries(schema.properties);
523
- if (params.length > 0) {
524
- lines.push("Parameters:");
525
- for (const [name, prop] of params) {
526
- const required = schema.required?.includes(name) ? " (required)" : "";
527
- lines.push(` - \`${name}\`: ${prop.description || prop.type}${required}`);
528
- }
529
- }
530
- }
531
- lines.push("");
532
- }
533
- }
534
- return lines.join("\n");
535
- }
536
- /**
537
- * Check if the manager is initialized
538
- */
539
- isInitialized() {
540
- return this.initialized;
541
- }
542
- /**
543
- * Get configuration file path
544
- */
545
- getConfigPath() {
546
- return this.configPath;
547
- }
548
- /**
549
- * Clear tool cache
550
- */
551
- clearCache() {
552
- this.toolCache.clear();
553
- }
554
- }
555
- let managerInstance = null;
556
- async function getMcpServerManager() {
557
- if (!managerInstance) {
558
- managerInstance = new McpServerManager();
559
- await managerInstance.initialize();
560
- }
561
- return managerInstance;
562
- }
563
-
564
- const AGENT_TEMPLATES_DIR = join(CCJK_CONFIG_DIR, "agent-templates");
565
- class AgentBuilder {
566
- definition = {
567
- skills: [],
568
- mcpServers: [],
569
- capabilities: []
570
- };
571
- /**
572
- * Set agent ID
573
- */
574
- id(id) {
575
- this.definition.id = id;
576
- return this;
577
- }
578
- /**
579
- * Set agent name
580
- */
581
- name(name) {
582
- this.definition.name = typeof name === "string" ? { "en": name, "zh-CN": name } : name;
583
- return this;
584
- }
585
- /**
586
- * Set agent description
587
- */
588
- description(desc) {
589
- this.definition.description = typeof desc === "string" ? { "en": desc, "zh-CN": desc } : desc;
590
- return this;
591
- }
592
- /**
593
- * Set agent persona/role
594
- */
595
- persona(persona) {
596
- this.definition.persona = persona;
597
- return this;
598
- }
599
- /**
600
- * Set agent instructions
601
- */
602
- instructions(instructions) {
603
- this.definition.instructions = instructions;
604
- return this;
605
- }
606
- /**
607
- * Add a skill
608
- */
609
- addSkill(pluginId, options = {}) {
610
- this.definition.skills.push({
611
- pluginId,
612
- ...options
613
- });
614
- return this;
615
- }
616
- /**
617
- * Add multiple skills
618
- */
619
- addSkills(pluginIds) {
620
- for (const id of pluginIds) {
621
- this.addSkill(id);
622
- }
623
- return this;
624
- }
625
- /**
626
- * Add an MCP server
627
- */
628
- addMcpServer(serverName, options = {}) {
629
- this.definition.mcpServers.push({
630
- serverName,
631
- ...options
632
- });
633
- return this;
634
- }
635
- /**
636
- * Add multiple MCP servers
637
- */
638
- addMcpServers(serverNames) {
639
- for (const name of serverNames) {
640
- this.addMcpServer(name);
641
- }
642
- return this;
643
- }
644
- /**
645
- * Add capability
646
- */
647
- addCapability(capability) {
648
- if (!this.definition.capabilities.includes(capability)) {
649
- this.definition.capabilities.push(capability);
650
- }
651
- return this;
652
- }
653
- /**
654
- * Add multiple capabilities
655
- */
656
- addCapabilities(capabilities) {
657
- for (const cap of capabilities) {
658
- this.addCapability(cap);
659
- }
660
- return this;
661
- }
662
- /**
663
- * Set trigger patterns
664
- */
665
- triggers(patterns) {
666
- this.definition.triggers = patterns;
667
- return this;
668
- }
669
- /**
670
- * Build the agent definition
671
- */
672
- build() {
673
- if (!this.definition.id) {
674
- throw new Error("Agent ID is required");
675
- }
676
- if (!this.definition.name) {
677
- throw new Error("Agent name is required");
678
- }
679
- if (!this.definition.description) {
680
- throw new Error("Agent description is required");
681
- }
682
- if (!this.definition.persona) {
683
- this.definition.persona = "You are a helpful AI assistant.";
684
- }
685
- if (!this.definition.instructions) {
686
- this.definition.instructions = "";
687
- }
688
- return this.definition;
689
- }
690
- /**
691
- * Build and save the agent
692
- */
693
- async save() {
694
- const definition = this.build();
695
- const manager = await getPluginManager();
696
- await manager.createAgent(definition);
697
- return definition;
698
- }
699
- }
700
- class AgentCreator {
701
- /**
702
- * Create a new agent builder
703
- */
704
- create() {
705
- return new AgentBuilder();
706
- }
707
- /**
708
- * Create agent from template
709
- */
710
- async fromTemplate(templateId, overrides = {}) {
711
- const template = await this.loadTemplate(templateId);
712
- if (!template) {
713
- throw new Error(`Template not found: ${templateId}`);
714
- }
715
- const definition = {
716
- id: overrides.id || `${templateId}-${Date.now()}`,
717
- name: overrides.name || template.name || { "en": templateId, "zh-CN": templateId },
718
- description: overrides.description || template.description || { "en": "", "zh-CN": "" },
719
- persona: overrides.persona || template.persona || "",
720
- instructions: overrides.instructions || template.instructions || "",
721
- skills: [...template.skills || [], ...overrides.skills || []],
722
- mcpServers: [...template.mcpServers || [], ...overrides.mcpServers || []],
723
- capabilities: [.../* @__PURE__ */ new Set([...template.capabilities || [], ...overrides.capabilities || []])],
724
- triggers: overrides.triggers || template.triggers,
725
- intents: overrides.intents || template.intents
726
- };
727
- const manager = await getPluginManager();
728
- await manager.createAgent(definition);
729
- return definition;
730
- }
731
- /**
732
- * Create agent from skills only
733
- */
734
- async fromSkills(id, name, skillIds, options = {}) {
735
- const builder = this.create().id(id).name(name).description(options.description || `Agent using skills: ${skillIds.join(", ")}`).addSkills(skillIds);
736
- if (options.persona) {
737
- builder.persona(options.persona);
738
- }
739
- if (options.instructions) {
740
- builder.instructions(options.instructions);
741
- }
742
- return builder.save();
743
- }
744
- /**
745
- * Create agent from MCP servers only
746
- */
747
- async fromMcpServers(id, name, serverNames, options = {}) {
748
- const builder = this.create().id(id).name(name).description(options.description || `Agent using MCP servers: ${serverNames.join(", ")}`).addMcpServers(serverNames);
749
- if (options.persona) {
750
- builder.persona(options.persona);
751
- }
752
- if (options.instructions) {
753
- builder.instructions(options.instructions);
754
- }
755
- return builder.save();
756
- }
757
- /**
758
- * Load a template
759
- */
760
- async loadTemplate(templateId) {
761
- const builtIn = BUILT_IN_TEMPLATES[templateId];
762
- if (builtIn) {
763
- return builtIn;
764
- }
765
- const templatePath = join(AGENT_TEMPLATES_DIR, `${templateId}.json`);
766
- if (existsSync(templatePath)) {
767
- return JSON.parse(readFileSync(templatePath, "utf-8"));
768
- }
769
- return null;
770
- }
771
- /**
772
- * Save a template
773
- */
774
- async saveTemplate(templateId, template) {
775
- if (!existsSync(AGENT_TEMPLATES_DIR)) {
776
- mkdirSync(AGENT_TEMPLATES_DIR, { recursive: true });
777
- }
778
- const templatePath = join(AGENT_TEMPLATES_DIR, `${templateId}.json`);
779
- writeFileSync(templatePath, JSON.stringify(template, null, 2));
780
- }
781
- /**
782
- * List available templates
783
- */
784
- listTemplates() {
785
- const templates = Object.keys(BUILT_IN_TEMPLATES);
786
- if (existsSync(AGENT_TEMPLATES_DIR)) {
787
- const files = readdirSync(AGENT_TEMPLATES_DIR);
788
- for (const file of files) {
789
- if (file.endsWith(".json") || file.endsWith(".md")) {
790
- templates.push(file.replace(/\.(json|md)$/, ""));
791
- }
792
- }
793
- }
794
- return templates;
795
- }
796
- /**
797
- * Write agent to Claude Code compatible location (project-local .claude-code/agents/)
798
- */
799
- async writeToClaudeCode(agent, options) {
800
- return writeAgentFile(agent, {
801
- format: "markdown",
802
- projectDir: options?.projectDir,
803
- global: false
804
- });
805
- }
806
- }
807
- class AgentRuntime {
808
- context;
809
- constructor(context) {
810
- this.context = context;
811
- }
812
- /**
813
- * Create runtime from agent ID
814
- */
815
- static async fromAgentId(agentId) {
816
- const manager = await getPluginManager();
817
- const agent = manager.getAgent(agentId);
818
- if (!agent) {
819
- throw new Error(`Agent not found: ${agentId}`);
820
- }
821
- const skills = [];
822
- for (const skillRef of agent.skills) {
823
- const plugin = manager.getPlugin(skillRef.pluginId);
824
- if (plugin) {
825
- skills.push(plugin);
826
- }
827
- }
828
- let mcpTools = [];
829
- if (agent.mcpServers && agent.mcpServers.length > 0) {
830
- try {
831
- const mcpManager = await getMcpServerManager();
832
- mcpTools = await mcpManager.getToolsForAgent(agent.mcpServers);
833
- } catch (error) {
834
- console.warn("Failed to load MCP tools:", error instanceof Error ? error.message : String(error));
835
- }
836
- }
837
- return new AgentRuntime({
838
- agent,
839
- skills,
840
- mcpTools,
841
- task: "",
842
- history: []
843
- });
844
- }
845
- /**
846
- * Get the system prompt for this agent
847
- */
848
- getSystemPrompt() {
849
- const parts = [];
850
- parts.push(this.context.agent.persona);
851
- parts.push("");
852
- if (this.context.agent.instructions) {
853
- parts.push("## Instructions");
854
- parts.push(this.context.agent.instructions);
855
- parts.push("");
856
- }
857
- if (this.context.skills.length > 0) {
858
- parts.push("## Available Skills");
859
- parts.push("");
860
- for (const skill of this.context.skills) {
861
- if (skill.skill) {
862
- parts.push(`### ${skill.skill.title}`);
863
- parts.push(skill.skill.description);
864
- parts.push("");
865
- if (skill.skill.applicability.taskTypes.length > 0) {
866
- parts.push("**When to use:**");
867
- for (const task of skill.skill.applicability.taskTypes) {
868
- parts.push(`- ${task}`);
869
- }
870
- parts.push("");
871
- }
872
- if (skill.skill.rules && skill.skill.rules.length > 0) {
873
- parts.push("**Key Rules:**");
874
- const criticalRules = skill.skill.rules.filter((r) => r.priority === "critical" || r.priority === "high");
875
- for (const rule of criticalRules.slice(0, 5)) {
876
- parts.push(`- **${rule.id}**: ${rule.title}`);
877
- }
878
- parts.push("");
879
- }
880
- }
881
- }
882
- }
883
- if (this.context.mcpTools.length > 0) {
884
- parts.push("## Available MCP Tools");
885
- parts.push("");
886
- const byServer = /* @__PURE__ */ new Map();
887
- for (const tool of this.context.mcpTools) {
888
- const serverTools = byServer.get(tool.server) || [];
889
- serverTools.push(tool);
890
- byServer.set(tool.server, serverTools);
891
- }
892
- for (const [server, serverTools] of byServer) {
893
- parts.push(`### ${server}`);
894
- parts.push("");
895
- for (const tool of serverTools) {
896
- parts.push(`**${tool.name}**: ${tool.description}`);
897
- const schema = tool.inputSchema;
898
- if (schema.properties) {
899
- const params = Object.entries(schema.properties);
900
- if (params.length > 0) {
901
- parts.push("Parameters:");
902
- for (const [name, prop] of params) {
903
- const required = schema.required?.includes(name) ? " (required)" : "";
904
- parts.push(` - \`${name}\`: ${prop.description || prop.type}${required}`);
905
- }
906
- }
907
- }
908
- parts.push("");
909
- }
910
- }
911
- }
912
- if (this.context.agent.capabilities.length > 0) {
913
- parts.push("## Capabilities");
914
- parts.push("");
915
- for (const cap of this.context.agent.capabilities) {
916
- parts.push(`- ${this.formatCapability(cap)}`);
917
- }
918
- parts.push("");
919
- }
920
- return parts.join("\n");
921
- }
922
- /**
923
- * Get full skill content for context
924
- */
925
- getSkillContent() {
926
- const parts = [];
927
- for (const skill of this.context.skills) {
928
- if (skill.skill) {
929
- parts.push(`# ${skill.skill.title}`);
930
- parts.push("");
931
- parts.push(skill.skill.rawContent);
932
- parts.push("");
933
- parts.push("---");
934
- parts.push("");
935
- }
936
- }
937
- return parts.join("\n");
938
- }
939
- /**
940
- * Add message to history
941
- */
942
- addMessage(role, content) {
943
- this.context.history = this.context.history || [];
944
- this.context.history.push({
945
- role,
946
- content,
947
- timestamp: Date.now()
948
- });
949
- }
950
- /**
951
- * Get conversation history
952
- */
953
- getHistory() {
954
- return this.context.history || [];
955
- }
956
- /**
957
- * Set current task
958
- */
959
- setTask(task) {
960
- this.context.task = task;
961
- }
962
- /**
963
- * Format capability for display
964
- */
965
- formatCapability(cap) {
966
- const labels = {
967
- "code-generation": "Code Generation",
968
- "code-review": "Code Review",
969
- "testing": "Testing",
970
- "documentation": "Documentation",
971
- "deployment": "Deployment",
972
- "debugging": "Debugging",
973
- "refactoring": "Refactoring",
974
- "git-operations": "Git Operations",
975
- "file-management": "File Management",
976
- "web-search": "Web Search",
977
- "api-integration": "API Integration"
978
- };
979
- return labels[cap] || cap;
980
- }
981
- }
982
- const BUILT_IN_TEMPLATES = {
983
- "code-assistant": {
984
- name: { "en": "Code Assistant", "zh-CN": "\u4EE3\u7801\u52A9\u624B" },
985
- description: { "en": "General-purpose coding assistant", "zh-CN": "\u901A\u7528\u7F16\u7A0B\u52A9\u624B" },
986
- persona: `You are an expert software engineer with deep knowledge of multiple programming languages and frameworks. You write clean, efficient, and well-documented code. You follow best practices and design patterns.`,
987
- capabilities: ["code-generation", "code-review", "debugging", "refactoring"],
988
- instructions: `
989
- - Always explain your reasoning before writing code
990
- - Follow the project's existing code style
991
- - Write comprehensive error handling
992
- - Add helpful comments for complex logic
993
- - Suggest tests for new functionality
994
- `
995
- },
996
- "git-master": {
997
- name: { "en": "Git Master", "zh-CN": "Git \u5927\u5E08" },
998
- description: { "en": "Expert Git operations assistant", "zh-CN": "Git \u64CD\u4F5C\u4E13\u5BB6" },
999
- persona: `You are a Git expert who helps with version control operations. You write clear, conventional commit messages and help manage branches effectively.`,
1000
- capabilities: ["git-operations"],
1001
- instructions: `
1002
- - Use conventional commit format (feat:, fix:, docs:, etc.)
1003
- - Suggest appropriate branch names
1004
- - Help resolve merge conflicts
1005
- - Explain Git concepts when needed
1006
- `
1007
- },
1008
- "test-engineer": {
1009
- name: { "en": "Test Engineer", "zh-CN": "\u6D4B\u8BD5\u5DE5\u7A0B\u5E08" },
1010
- description: { "en": "Testing and quality assurance specialist", "zh-CN": "\u6D4B\u8BD5\u548C\u8D28\u91CF\u4FDD\u8BC1\u4E13\u5BB6" },
1011
- persona: `You are a QA engineer specializing in software testing. You write comprehensive test cases and help ensure code quality.`,
1012
- capabilities: ["testing", "code-review"],
1013
- instructions: `
1014
- - Write tests that cover edge cases
1015
- - Use appropriate testing frameworks (Jest, Vitest, etc.)
1016
- - Follow AAA pattern (Arrange, Act, Assert)
1017
- - Aim for high test coverage
1018
- - Include both unit and integration tests
1019
- `
1020
- },
1021
- "devops-engineer": {
1022
- name: { "en": "DevOps Engineer", "zh-CN": "DevOps \u5DE5\u7A0B\u5E08" },
1023
- description: { "en": "DevOps and deployment specialist", "zh-CN": "DevOps \u548C\u90E8\u7F72\u4E13\u5BB6" },
1024
- persona: `You are a DevOps engineer who helps with CI/CD, containerization, and deployment. You write efficient Dockerfiles and deployment configurations.`,
1025
- capabilities: ["deployment", "file-management"],
1026
- instructions: `
1027
- - Write optimized Dockerfiles with multi-stage builds
1028
- - Create comprehensive CI/CD pipelines
1029
- - Follow security best practices
1030
- - Use environment variables for configuration
1031
- - Document deployment procedures
1032
- `
1033
- },
1034
- "full-stack": {
1035
- name: { "en": "Full Stack Developer", "zh-CN": "\u5168\u6808\u5F00\u53D1\u8005" },
1036
- description: { "en": "Full stack development assistant", "zh-CN": "\u5168\u6808\u5F00\u53D1\u52A9\u624B" },
1037
- persona: `You are a full-stack developer proficient in both frontend and backend development. You build complete, production-ready applications.`,
1038
- capabilities: ["code-generation", "code-review", "testing", "documentation", "deployment"],
1039
- instructions: `
1040
- - Consider both frontend and backend implications
1041
- - Write responsive and accessible UI
1042
- - Design RESTful APIs
1043
- - Implement proper authentication and authorization
1044
- - Optimize for performance
1045
- `
1046
- }
1047
- };
1048
- let creatorInstance = null;
1049
- function getAgentCreator() {
1050
- if (!creatorInstance) {
1051
- creatorInstance = new AgentCreator();
1052
- }
1053
- return creatorInstance;
1054
- }
1055
- function createAgent() {
1056
- return new AgentBuilder();
1057
- }
1058
- async function createAgentFromTemplate(templateId, overrides = {}) {
1059
- const creator = getAgentCreator();
1060
- return creator.fromTemplate(templateId, overrides);
1061
- }
1062
- async function getAgentRuntime(agentId) {
1063
- return AgentRuntime.fromAgentId(agentId);
1064
- }
1065
-
1066
- async function handleAgentCommand(args, options = {}) {
1067
- const subcommand = args[0];
1068
- const restArgs = args.slice(1);
1069
- switch (subcommand) {
1070
- case "create":
1071
- case "new":
1072
- await createNewAgent(restArgs[0], options);
1073
- break;
1074
- case "list":
1075
- case "ls":
1076
- await listAgents(options);
1077
- break;
1078
- case "info":
1079
- case "show":
1080
- await showAgentInfo(restArgs[0], options);
1081
- break;
1082
- case "remove":
1083
- case "rm":
1084
- case "delete":
1085
- await removeAgent(restArgs[0]);
1086
- break;
1087
- case "run":
1088
- case "start":
1089
- await runAgent(restArgs[0], restArgs.slice(1).join(" "));
1090
- break;
1091
- case "templates":
1092
- await listTemplates(options);
1093
- break;
1094
- default:
1095
- showAgentHelp();
1096
- }
1097
- }
1098
- async function createNewAgent(name, options) {
1099
- if (!name) {
1100
- console.log(a.red("Error: Please specify an agent name"));
1101
- console.log(a.dim("Example: agent create my-assistant"));
1102
- return;
1103
- }
1104
- console.log(a.cyan(`
1105
- \u{1F916} Creating agent: ${name}
1106
- `));
1107
- try {
1108
- let agent;
1109
- if (options.template) {
1110
- console.log(a.dim(`Using template: ${options.template}`));
1111
- agent = await createAgentFromTemplate(options.template, {
1112
- id: name,
1113
- name: { "en": name, "zh-CN": name }
1114
- });
1115
- } else {
1116
- const builder = createAgent().id(name).name(name).description(`Custom agent: ${name}`);
1117
- if (options.skills && options.skills.length > 0) {
1118
- builder.addSkills(options.skills);
1119
- console.log(a.dim(`Adding skills: ${options.skills.join(", ")}`));
1120
- }
1121
- if (options.mcp && options.mcp.length > 0) {
1122
- builder.addMcpServers(options.mcp);
1123
- console.log(a.dim(`Adding MCP servers: ${options.mcp.join(", ")}`));
1124
- }
1125
- if (options.persona) {
1126
- builder.persona(options.persona);
1127
- }
1128
- agent = await builder.save();
1129
- }
1130
- console.log(a.green(`
1131
- \u2705 Agent created successfully!`));
1132
- console.log("");
1133
- console.log(a.bold("Agent Details:"));
1134
- console.log(a.dim(` ID: ${agent.id}`));
1135
- console.log(a.dim(` Name: ${agent.name.en}`));
1136
- console.log(a.dim(` Skills: ${agent.skills.length}`));
1137
- console.log(a.dim(` MCP Servers: ${agent.mcpServers.length}`));
1138
- console.log(a.dim(` Capabilities: ${agent.capabilities.join(", ")}`));
1139
- console.log("");
1140
- console.log(a.dim(`Run with: agent run ${agent.id}`));
1141
- } catch (error) {
1142
- console.log(a.red(`\u274C Failed to create agent: ${error instanceof Error ? error.message : error}`));
1143
- }
1144
- }
1145
- async function listAgents(options) {
1146
- const manager = await getPluginManager();
1147
- const agents = manager.listAgents();
1148
- if (options.json) {
1149
- console.log(JSON.stringify(agents, null, 2));
1150
- return;
1151
- }
1152
- console.log(a.cyan("\n\u{1F916} Installed Agents\n"));
1153
- if (agents.length === 0) {
1154
- console.log(a.dim("No agents created yet."));
1155
- console.log(a.dim("\nCreate an agent with:"));
1156
- console.log(a.dim(" agent create my-assistant --template code-assistant"));
1157
- console.log(a.dim(" agent create my-agent --skills git-helper,code-reviewer"));
1158
- return;
1159
- }
1160
- for (const agent of agents) {
1161
- const name = agent.name.en || agent.id;
1162
- console.log(` ${a.bold(name)} ${a.dim(`(${agent.id})`)}`);
1163
- console.log(a.dim(` ${agent.description.en}`));
1164
- const badges = [];
1165
- if (agent.skills.length > 0)
1166
- badges.push(`\u{1F4DA} ${agent.skills.length} skills`);
1167
- if (agent.mcpServers.length > 0)
1168
- badges.push(`\u{1F527} ${agent.mcpServers.length} MCP`);
1169
- if (agent.capabilities.length > 0)
1170
- badges.push(`\u26A1 ${agent.capabilities.length} capabilities`);
1171
- if (badges.length > 0) {
1172
- console.log(a.dim(` ${badges.join(" \u2022 ")}`));
1173
- }
1174
- console.log("");
1175
- }
1176
- console.log(a.dim(`Total: ${agents.length} agents`));
1177
- }
1178
- async function showAgentInfo(agentId, options) {
1179
- if (!agentId) {
1180
- console.log(a.red("Error: Please specify an agent ID"));
1181
- return;
1182
- }
1183
- const manager = await getPluginManager();
1184
- const agent = manager.getAgent(agentId);
1185
- if (!agent) {
1186
- console.log(a.red(`Agent not found: ${agentId}`));
1187
- return;
1188
- }
1189
- if (options.json) {
1190
- console.log(JSON.stringify(agent, null, 2));
1191
- return;
1192
- }
1193
- console.log("");
1194
- console.log(a.bold(a.cyan(`\u{1F916} ${agent.name.en}`)));
1195
- console.log(a.dim(`ID: ${agent.id}`));
1196
- console.log("");
1197
- console.log(a.bold("\u{1F4DD} Description"));
1198
- console.log(a.dim(` ${agent.description.en}`));
1199
- console.log("");
1200
- console.log(a.bold("\u{1F3AD} Persona"));
1201
- console.log(a.dim(` ${agent.persona.substring(0, 200)}${agent.persona.length > 200 ? "..." : ""}`));
1202
- console.log("");
1203
- if (agent.instructions) {
1204
- console.log(a.bold("\u{1F4CB} Instructions"));
1205
- const lines = agent.instructions.split("\n").slice(0, 5);
1206
- for (const line of lines) {
1207
- console.log(a.dim(` ${line}`));
1208
- }
1209
- if (agent.instructions.split("\n").length > 5) {
1210
- console.log(a.dim(" ..."));
1211
- }
1212
- console.log("");
1213
- }
1214
- if (agent.skills.length > 0) {
1215
- console.log(a.bold("\u{1F4DA} Skills"));
1216
- for (const skill of agent.skills) {
1217
- const plugin = manager.getPlugin(skill.pluginId);
1218
- const name = plugin?.manifest.name.en || skill.pluginId;
1219
- console.log(a.dim(` \u2022 ${name}`));
1220
- }
1221
- console.log("");
1222
- }
1223
- if (agent.mcpServers.length > 0) {
1224
- console.log(a.bold("\u{1F527} MCP Servers"));
1225
- for (const mcp of agent.mcpServers) {
1226
- console.log(a.dim(` \u2022 ${mcp.serverName}`));
1227
- if (mcp.tools && mcp.tools.length > 0) {
1228
- console.log(a.dim(` Tools: ${mcp.tools.join(", ")}`));
1229
- }
1230
- }
1231
- console.log("");
1232
- }
1233
- if (agent.capabilities.length > 0) {
1234
- console.log(a.bold("\u26A1 Capabilities"));
1235
- for (const cap of agent.capabilities) {
1236
- console.log(a.dim(` \u2022 ${formatCapability(cap)}`));
1237
- }
1238
- console.log("");
1239
- }
1240
- if (agent.triggers && agent.triggers.length > 0) {
1241
- console.log(a.bold("\u{1F3AF} Triggers"));
1242
- for (const trigger of agent.triggers) {
1243
- console.log(a.dim(` \u2022 ${trigger}`));
1244
- }
1245
- console.log("");
1246
- }
1247
- console.log(a.bold("\u{1F4AC} System Prompt Preview"));
1248
- try {
1249
- const runtime = await getAgentRuntime(agentId);
1250
- const prompt = runtime.getSystemPrompt();
1251
- const lines = prompt.split("\n").slice(0, 10);
1252
- for (const line of lines) {
1253
- console.log(a.dim(` ${line}`));
1254
- }
1255
- console.log(a.dim(" ..."));
1256
- } catch {
1257
- console.log(a.dim(" (Unable to generate preview)"));
1258
- }
1259
- }
1260
- async function removeAgent(agentId) {
1261
- if (!agentId) {
1262
- console.log(a.red("Error: Please specify an agent ID"));
1263
- return;
1264
- }
1265
- const manager = await getPluginManager();
1266
- const agent = manager.getAgent(agentId);
1267
- if (!agent) {
1268
- console.log(a.red(`Agent not found: ${agentId}`));
1269
- return;
1270
- }
1271
- console.log(a.yellow(`
1272
- \u26A0\uFE0F Removing agent: ${agent.name.en}`));
1273
- console.log(a.red("Agent removal not yet implemented"));
1274
- }
1275
- async function runAgent(agentId, task) {
1276
- if (!agentId) {
1277
- console.log(a.red("Error: Please specify an agent ID"));
1278
- return;
1279
- }
1280
- const manager = await getPluginManager();
1281
- const agent = manager.getAgent(agentId);
1282
- if (!agent) {
1283
- console.log(a.red(`Agent not found: ${agentId}`));
1284
- return;
1285
- }
1286
- console.log(a.cyan(`
1287
- \u{1F916} Starting agent: ${agent.name.en}
1288
- `));
1289
- try {
1290
- const runtime = await getAgentRuntime(agentId);
1291
- console.log(a.bold("System Prompt:"));
1292
- console.log(a.dim("\u2500".repeat(60)));
1293
- console.log(a.dim(runtime.getSystemPrompt()));
1294
- console.log(a.dim("\u2500".repeat(60)));
1295
- console.log("");
1296
- if (task) {
1297
- runtime.setTask(task);
1298
- console.log(a.bold("Task:"));
1299
- console.log(a.dim(task));
1300
- console.log("");
1301
- }
1302
- const skillContent = runtime.getSkillContent();
1303
- if (skillContent) {
1304
- console.log(a.bold("Skill Knowledge:"));
1305
- console.log(a.dim("\u2500".repeat(60)));
1306
- const lines = skillContent.split("\n").slice(0, 20);
1307
- for (const line of lines) {
1308
- console.log(a.dim(line));
1309
- }
1310
- if (skillContent.split("\n").length > 20) {
1311
- console.log(a.dim("... (truncated)"));
1312
- }
1313
- console.log(a.dim("\u2500".repeat(60)));
1314
- }
1315
- console.log("");
1316
- console.log(a.green("\u2705 Agent ready!"));
1317
- console.log(a.dim("The system prompt and skill knowledge above can be used with Claude."));
1318
- } catch (error) {
1319
- console.log(a.red(`\u274C Failed to start agent: ${error instanceof Error ? error.message : error}`));
1320
- }
1321
- }
1322
- async function listTemplates(options) {
1323
- const creator = getAgentCreator();
1324
- const templates = creator.listTemplates();
1325
- if (options.json) {
1326
- console.log(JSON.stringify(templates, null, 2));
1327
- return;
1328
- }
1329
- console.log(a.cyan("\n\u{1F4CB} Available Agent Templates\n"));
1330
- const templateInfo = {
1331
- "code-assistant": {
1332
- name: "Code Assistant",
1333
- description: "General-purpose coding assistant",
1334
- capabilities: ["code-generation", "code-review", "debugging", "refactoring"]
1335
- },
1336
- "git-master": {
1337
- name: "Git Master",
1338
- description: "Expert Git operations assistant",
1339
- capabilities: ["git-operations"]
1340
- },
1341
- "test-engineer": {
1342
- name: "Test Engineer",
1343
- description: "Testing and quality assurance specialist",
1344
- capabilities: ["testing", "code-review"]
1345
- },
1346
- "devops-engineer": {
1347
- name: "DevOps Engineer",
1348
- description: "DevOps and deployment specialist",
1349
- capabilities: ["deployment", "file-management"]
1350
- },
1351
- "full-stack": {
1352
- name: "Full Stack Developer",
1353
- description: "Full stack development assistant",
1354
- capabilities: ["code-generation", "code-review", "testing", "documentation", "deployment"]
1355
- }
1356
- };
1357
- for (const templateId of templates) {
1358
- const info = templateInfo[templateId];
1359
- if (info) {
1360
- console.log(` ${a.bold(info.name)} ${a.dim(`(${templateId})`)}`);
1361
- console.log(a.dim(` ${info.description}`));
1362
- console.log(a.dim(` Capabilities: ${info.capabilities.join(", ")}`));
1363
- console.log("");
1364
- } else {
1365
- console.log(` ${a.bold(templateId)}`);
1366
- console.log("");
1367
- }
1368
- }
1369
- console.log(a.dim("Create an agent from template:"));
1370
- console.log(a.dim(" agent create my-assistant --template code-assistant"));
1371
- }
1372
- function formatCapability(cap) {
1373
- const labels = {
1374
- "code-generation": "Code Generation",
1375
- "code-review": "Code Review",
1376
- "testing": "Testing",
1377
- "documentation": "Documentation",
1378
- "deployment": "Deployment",
1379
- "debugging": "Debugging",
1380
- "refactoring": "Refactoring",
1381
- "git-operations": "Git Operations",
1382
- "file-management": "File Management",
1383
- "web-search": "Web Search",
1384
- "api-integration": "API Integration"
1385
- };
1386
- return labels[cap] || cap;
1387
- }
1388
- function showAgentHelp() {
1389
- console.log(`
1390
- ${a.bold(a.cyan("\u{1F916} Agent Command"))}
1391
-
1392
- ${a.bold("Usage:")}
1393
- agent <command> [options]
1394
-
1395
- ${a.bold("Commands:")}
1396
- ${a.green("create")} <name> Create a new agent
1397
- ${a.green("list")} List all agents
1398
- ${a.green("info")} <id> Show agent details
1399
- ${a.green("remove")} <id> Remove an agent
1400
- ${a.green("run")} <id> [task] Run an agent
1401
- ${a.green("templates")} List available templates
1402
-
1403
- ${a.bold("Options:")}
1404
- --template <id> Use a template (code-assistant, git-master, etc.)
1405
- --skills <ids> Comma-separated skill IDs to include
1406
- --mcp <servers> Comma-separated MCP server names
1407
- --persona <text> Custom persona for the agent
1408
- --json Output as JSON
1409
-
1410
- ${a.bold("Examples:")}
1411
- ${a.dim("# Create from template")}
1412
- agent create my-assistant --template code-assistant
1413
-
1414
- ${a.dim("# Create with specific skills")}
1415
- agent create reviewer --skills code-reviewer,react-best-practices
1416
-
1417
- ${a.dim("# Create with MCP servers")}
1418
- agent create deployer --mcp vercel,github --skills vercel-deploy
1419
-
1420
- ${a.dim("# List all agents")}
1421
- agent list
1422
-
1423
- ${a.dim("# Run an agent")}
1424
- agent run my-assistant "Review this code"
1425
-
1426
- ${a.bold("Agent Composition:")}
1427
- Agents combine Skills (knowledge) + MCP (tools) + Persona (behavior)
1428
-
1429
- \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
1430
- \u2502 Agent \u2502
1431
- \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502
1432
- \u2502 \u2502 Skills \u2502 +\u2502 MCP \u2502 +\u2502 Persona \u2502 \u2502
1433
- \u2502 \u2502(\u77E5\u8BC6\u5E93) \u2502 \u2502 (\u5DE5\u5177) \u2502 \u2502 (\u884C\u4E3A) \u2502 \u2502
1434
- \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502
1435
- \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
1436
- `);
1437
- }
1438
-
1439
- export { handleAgentCommand as default, handleAgentCommand };