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.
- package/package.json +1 -1
- package/dist/chunks/agent-teams.mjs +0 -136
- package/dist/chunks/agent.mjs +0 -1439
- package/dist/chunks/agents.mjs +0 -3778
- package/dist/chunks/api-cli.mjs +0 -132
- package/dist/chunks/api-providers.mjs +0 -129
- package/dist/chunks/api.mjs +0 -112
- package/dist/chunks/auto-bootstrap.mjs +0 -358
- package/dist/chunks/auto-init.mjs +0 -7584
- package/dist/chunks/auto-updater.mjs +0 -410
- package/dist/chunks/banner.mjs +0 -188
- package/dist/chunks/bash.mjs +0 -187
- package/dist/chunks/boost.mjs +0 -397
- package/dist/chunks/ccjk-agents.mjs +0 -414
- package/dist/chunks/ccjk-all.mjs +0 -1028
- package/dist/chunks/ccjk-config.mjs +0 -261
- package/dist/chunks/ccjk-hooks.mjs +0 -1074
- package/dist/chunks/ccjk-mcp.mjs +0 -761
- package/dist/chunks/ccjk-setup.mjs +0 -763
- package/dist/chunks/ccjk-skills.mjs +0 -514
- package/dist/chunks/ccr.mjs +0 -98
- package/dist/chunks/ccu.mjs +0 -40
- package/dist/chunks/check-updates.mjs +0 -108
- package/dist/chunks/claude-code-config-manager.mjs +0 -750
- package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
- package/dist/chunks/claude-config.mjs +0 -236
- package/dist/chunks/claude-wrapper.mjs +0 -85
- package/dist/chunks/cleanup-migration.mjs +0 -20
- package/dist/chunks/cli-hook.mjs +0 -2285
- package/dist/chunks/cloud-sync.mjs +0 -29
- package/dist/chunks/codex-config-switch.mjs +0 -451
- package/dist/chunks/codex-provider-manager.mjs +0 -236
- package/dist/chunks/codex-uninstaller.mjs +0 -404
- package/dist/chunks/codex.mjs +0 -2077
- package/dist/chunks/commands.mjs +0 -108
- package/dist/chunks/commands2.mjs +0 -413
- package/dist/chunks/commit.mjs +0 -138
- package/dist/chunks/completion.mjs +0 -515
- package/dist/chunks/config-consolidator.mjs +0 -172
- package/dist/chunks/config-switch.mjs +0 -317
- package/dist/chunks/config.mjs +0 -379
- package/dist/chunks/config2.mjs +0 -477
- package/dist/chunks/config3.mjs +0 -470
- package/dist/chunks/constants.mjs +0 -133
- package/dist/chunks/context-loader.mjs +0 -343
- package/dist/chunks/context.mjs +0 -372
- package/dist/chunks/convoy-manager.mjs +0 -880
- package/dist/chunks/dashboard.mjs +0 -476
- package/dist/chunks/doctor.mjs +0 -964
- package/dist/chunks/evolution.mjs +0 -382
- package/dist/chunks/features.mjs +0 -698
- package/dist/chunks/fish.mjs +0 -181
- package/dist/chunks/fs-operations.mjs +0 -192
- package/dist/chunks/health-alerts.mjs +0 -304
- package/dist/chunks/health-check.mjs +0 -532
- package/dist/chunks/help.mjs +0 -340
- package/dist/chunks/hook-installer.mjs +0 -45
- package/dist/chunks/index.mjs +0 -24
- package/dist/chunks/index10.mjs +0 -1171
- package/dist/chunks/index11.mjs +0 -1008
- package/dist/chunks/index12.mjs +0 -193
- package/dist/chunks/index13.mjs +0 -218
- package/dist/chunks/index14.mjs +0 -663
- package/dist/chunks/index2.mjs +0 -19
- package/dist/chunks/index3.mjs +0 -19092
- package/dist/chunks/index4.mjs +0 -8
- package/dist/chunks/index5.mjs +0 -7600
- package/dist/chunks/index6.mjs +0 -171
- package/dist/chunks/index7.mjs +0 -3583
- package/dist/chunks/index8.mjs +0 -19
- package/dist/chunks/index9.mjs +0 -616
- package/dist/chunks/init.mjs +0 -1606
- package/dist/chunks/installer.mjs +0 -690
- package/dist/chunks/installer2.mjs +0 -179
- package/dist/chunks/interview.mjs +0 -2927
- package/dist/chunks/json-config.mjs +0 -60
- package/dist/chunks/linux.mjs +0 -3863
- package/dist/chunks/macos.mjs +0 -69
- package/dist/chunks/main.mjs +0 -635
- package/dist/chunks/manager.mjs +0 -1048
- package/dist/chunks/marketplace.mjs +0 -949
- package/dist/chunks/mcp-cli.mjs +0 -204
- package/dist/chunks/mcp-performance.mjs +0 -187
- package/dist/chunks/mcp.mjs +0 -1231
- package/dist/chunks/menu.mjs +0 -652
- package/dist/chunks/metrics-display.mjs +0 -153
- package/dist/chunks/migrator.mjs +0 -178
- package/dist/chunks/monitor.mjs +0 -1856
- package/dist/chunks/notification.mjs +0 -1864
- package/dist/chunks/onboarding.mjs +0 -385
- package/dist/chunks/package.mjs +0 -3
- package/dist/chunks/paradigm.mjs +0 -74
- package/dist/chunks/permission-manager.mjs +0 -132
- package/dist/chunks/permissions.mjs +0 -265
- package/dist/chunks/persistence-manager.mjs +0 -794
- package/dist/chunks/persistence.mjs +0 -667
- package/dist/chunks/platform.mjs +0 -391
- package/dist/chunks/plugin.mjs +0 -1936
- package/dist/chunks/powershell.mjs +0 -213
- package/dist/chunks/prompts.mjs +0 -241
- package/dist/chunks/providers.mjs +0 -260
- package/dist/chunks/quick-actions.mjs +0 -320
- package/dist/chunks/quick-provider.mjs +0 -682
- package/dist/chunks/quick-setup.mjs +0 -412
- package/dist/chunks/remote.mjs +0 -497
- package/dist/chunks/session.mjs +0 -878
- package/dist/chunks/sessions.mjs +0 -106
- package/dist/chunks/silent-updater.mjs +0 -396
- package/dist/chunks/simple-config.mjs +0 -98
- package/dist/chunks/skill.mjs +0 -117
- package/dist/chunks/skill2.mjs +0 -9003
- package/dist/chunks/skills-sync.mjs +0 -6460
- package/dist/chunks/skills.mjs +0 -567
- package/dist/chunks/slash-commands.mjs +0 -207
- package/dist/chunks/smart-defaults.mjs +0 -412
- package/dist/chunks/smart-guide.mjs +0 -194
- package/dist/chunks/startup.mjs +0 -487
- package/dist/chunks/stats.mjs +0 -410
- package/dist/chunks/status.mjs +0 -289
- package/dist/chunks/team.mjs +0 -63
- package/dist/chunks/thinking.mjs +0 -626
- package/dist/chunks/trace.mjs +0 -57
- package/dist/chunks/uninstall.mjs +0 -849
- package/dist/chunks/update.mjs +0 -167
- package/dist/chunks/upgrade-manager.mjs +0 -204
- package/dist/chunks/version-checker.mjs +0 -881
- package/dist/chunks/vim.mjs +0 -903
- package/dist/chunks/windows.mjs +0 -14
- package/dist/chunks/workflows.mjs +0 -633
- package/dist/chunks/wsl.mjs +0 -129
- package/dist/chunks/zero-config.mjs +0 -374
- package/dist/chunks/zsh.mjs +0 -182
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +0 -2199
- package/dist/i18n/locales/en/agent-teams.json +0 -18
- package/dist/i18n/locales/en/agentBrowser.json +0 -79
- package/dist/i18n/locales/en/agents.json +0 -135
- package/dist/i18n/locales/en/api.json +0 -63
- package/dist/i18n/locales/en/ccjk-agents.json +0 -33
- package/dist/i18n/locales/en/ccjk-all.json +0 -23
- package/dist/i18n/locales/en/ccjk-skills.json +0 -22
- package/dist/i18n/locales/en/ccjk.json +0 -276
- package/dist/i18n/locales/en/ccr.json +0 -65
- package/dist/i18n/locales/en/claude-md.json +0 -73
- package/dist/i18n/locales/en/cli.json +0 -152
- package/dist/i18n/locales/en/cloud-setup.json +0 -31
- package/dist/i18n/locales/en/cloud-sync.json +0 -147
- package/dist/i18n/locales/en/cloud.json +0 -40
- package/dist/i18n/locales/en/cloudPlugins.json +0 -118
- package/dist/i18n/locales/en/codex.json +0 -127
- package/dist/i18n/locales/en/cometix.json +0 -29
- package/dist/i18n/locales/en/common.json +0 -68
- package/dist/i18n/locales/en/config.json +0 -108
- package/dist/i18n/locales/en/configuration.json +0 -226
- package/dist/i18n/locales/en/context.json +0 -85
- package/dist/i18n/locales/en/dashboard.json +0 -78
- package/dist/i18n/locales/en/errors.json +0 -26
- package/dist/i18n/locales/en/evolution.json +0 -54
- package/dist/i18n/locales/en/hooks.json +0 -74
- package/dist/i18n/locales/en/hooksSync.json +0 -133
- package/dist/i18n/locales/en/installation.json +0 -83
- package/dist/i18n/locales/en/interview.json +0 -104
- package/dist/i18n/locales/en/language.json +0 -19
- package/dist/i18n/locales/en/lsp.json +0 -78
- package/dist/i18n/locales/en/marketplace.json +0 -116
- package/dist/i18n/locales/en/mcp.json +0 -178
- package/dist/i18n/locales/en/memory.json +0 -92
- package/dist/i18n/locales/en/menu.json +0 -143
- package/dist/i18n/locales/en/multi-config.json +0 -79
- package/dist/i18n/locales/en/notification.json +0 -307
- package/dist/i18n/locales/en/permissions.json +0 -95
- package/dist/i18n/locales/en/persistence.json +0 -127
- package/dist/i18n/locales/en/plugins.json +0 -146
- package/dist/i18n/locales/en/quick-actions.json +0 -78
- package/dist/i18n/locales/en/registry.json +0 -54
- package/dist/i18n/locales/en/remote.json +0 -93
- package/dist/i18n/locales/en/sandbox.json +0 -44
- package/dist/i18n/locales/en/setup.json +0 -44
- package/dist/i18n/locales/en/shencha.json +0 -14
- package/dist/i18n/locales/en/skills.json +0 -100
- package/dist/i18n/locales/en/skillsSync.json +0 -74
- package/dist/i18n/locales/en/smartGuide.json +0 -49
- package/dist/i18n/locales/en/stats.json +0 -20
- package/dist/i18n/locales/en/subagent.json +0 -69
- package/dist/i18n/locales/en/superpowers.json +0 -117
- package/dist/i18n/locales/en/team.json +0 -7
- package/dist/i18n/locales/en/thinking.json +0 -65
- package/dist/i18n/locales/en/tools.json +0 -42
- package/dist/i18n/locales/en/uninstall.json +0 -56
- package/dist/i18n/locales/en/updater.json +0 -29
- package/dist/i18n/locales/en/vim.json +0 -169
- package/dist/i18n/locales/en/workflow.json +0 -55
- package/dist/i18n/locales/en/workspace.json +0 -108
- package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
- package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
- package/dist/i18n/locales/zh-CN/agents.json +0 -135
- package/dist/i18n/locales/zh-CN/api.json +0 -63
- package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
- package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
- package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
- package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
- package/dist/i18n/locales/zh-CN/ccr.json +0 -65
- package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
- package/dist/i18n/locales/zh-CN/cli.json +0 -152
- package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
- package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
- package/dist/i18n/locales/zh-CN/cloud.json +0 -40
- package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
- package/dist/i18n/locales/zh-CN/codex.json +0 -127
- package/dist/i18n/locales/zh-CN/cometix.json +0 -29
- package/dist/i18n/locales/zh-CN/common.json +0 -68
- package/dist/i18n/locales/zh-CN/config.json +0 -108
- package/dist/i18n/locales/zh-CN/configuration.json +0 -224
- package/dist/i18n/locales/zh-CN/context.json +0 -85
- package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
- package/dist/i18n/locales/zh-CN/errors.json +0 -26
- package/dist/i18n/locales/zh-CN/evolution.json +0 -54
- package/dist/i18n/locales/zh-CN/hooks.json +0 -74
- package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
- package/dist/i18n/locales/zh-CN/installation.json +0 -83
- package/dist/i18n/locales/zh-CN/interview.json +0 -104
- package/dist/i18n/locales/zh-CN/language.json +0 -19
- package/dist/i18n/locales/zh-CN/lsp.json +0 -78
- package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
- package/dist/i18n/locales/zh-CN/mcp.json +0 -178
- package/dist/i18n/locales/zh-CN/memory.json +0 -92
- package/dist/i18n/locales/zh-CN/menu.json +0 -143
- package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
- package/dist/i18n/locales/zh-CN/notification.json +0 -307
- package/dist/i18n/locales/zh-CN/permissions.json +0 -95
- package/dist/i18n/locales/zh-CN/persistence.json +0 -127
- package/dist/i18n/locales/zh-CN/plugins.json +0 -146
- package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
- package/dist/i18n/locales/zh-CN/registry.json +0 -54
- package/dist/i18n/locales/zh-CN/remote.json +0 -93
- package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
- package/dist/i18n/locales/zh-CN/setup.json +0 -44
- package/dist/i18n/locales/zh-CN/shencha.json +0 -14
- package/dist/i18n/locales/zh-CN/skills.json +0 -100
- package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
- package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
- package/dist/i18n/locales/zh-CN/stats.json +0 -20
- package/dist/i18n/locales/zh-CN/subagent.json +0 -69
- package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
- package/dist/i18n/locales/zh-CN/team.json +0 -7
- package/dist/i18n/locales/zh-CN/thinking.json +0 -65
- package/dist/i18n/locales/zh-CN/tools.json +0 -42
- package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
- package/dist/i18n/locales/zh-CN/updater.json +0 -29
- package/dist/i18n/locales/zh-CN/vim.json +0 -169
- package/dist/i18n/locales/zh-CN/workflow.json +0 -55
- package/dist/i18n/locales/zh-CN/workspace.json +0 -108
- package/dist/index.d.mts +0 -5295
- package/dist/index.d.ts +0 -5295
- package/dist/index.mjs +0 -4941
- package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
- package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
- package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
- package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
- package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
- package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
- package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
- package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
- package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
- package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
- package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
- package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
- package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
- package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
- package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
- package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
- package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
- package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
- package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
- package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
- package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
- package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
- package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
- package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
- package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
- package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
- package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
- package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
- package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
- package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
- package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
- package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
- package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
- package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
- package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
- package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
- package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
- package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
- package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
- package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
- package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
- package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
package/dist/chunks/ccjk-mcp.mjs
DELETED
|
@@ -1,761 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
import { cwd } from 'node:process';
|
|
3
|
-
import a from './index2.mjs';
|
|
4
|
-
import { c as consola, g as getTemplatesClient } from '../shared/ccjk.UIvifqNE.mjs';
|
|
5
|
-
import { i as inquirer } from './index3.mjs';
|
|
6
|
-
import { a as analyzeProject } from '../shared/ccjk.DS7UESmF.mjs';
|
|
7
|
-
import { CLAUDE_DIR } from './constants.mjs';
|
|
8
|
-
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
9
|
-
import { b as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
|
|
10
|
-
import { h as commandExists } from './platform.mjs';
|
|
11
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
12
|
-
import 'node:readline';
|
|
13
|
-
import 'stream';
|
|
14
|
-
import 'node:tty';
|
|
15
|
-
import 'node:async_hooks';
|
|
16
|
-
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
17
|
-
import 'node:util';
|
|
18
|
-
import 'tty';
|
|
19
|
-
import 'fs';
|
|
20
|
-
import 'child_process';
|
|
21
|
-
import 'node:os';
|
|
22
|
-
import 'node:crypto';
|
|
23
|
-
import 'buffer';
|
|
24
|
-
import 'string_decoder';
|
|
25
|
-
import 'node:fs';
|
|
26
|
-
import './index8.mjs';
|
|
27
|
-
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
28
|
-
import 'tinyglobby';
|
|
29
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
30
|
-
import 'node:url';
|
|
31
|
-
import './json-config.mjs';
|
|
32
|
-
import '../shared/ccjk.RyizuzOI.mjs';
|
|
33
|
-
import './fs-operations.mjs';
|
|
34
|
-
import 'node:fs/promises';
|
|
35
|
-
import './main.mjs';
|
|
36
|
-
import 'module';
|
|
37
|
-
import 'node:child_process';
|
|
38
|
-
import 'node:stream';
|
|
39
|
-
|
|
40
|
-
const mcpServiceTemplates = {
|
|
41
|
-
// ============================================================================
|
|
42
|
-
// Language Server Integrations
|
|
43
|
-
// ============================================================================
|
|
44
|
-
"typescript-language-server": {
|
|
45
|
-
id: "typescript-language-server",
|
|
46
|
-
name: {
|
|
47
|
-
"en": "TypeScript Language Server",
|
|
48
|
-
"zh-CN": "TypeScript \u8BED\u8A00\u670D\u52A1\u5668"
|
|
49
|
-
},
|
|
50
|
-
description: {
|
|
51
|
-
"en": "Provides TypeScript/JavaScript language support with IntelliSense, error checking, and refactoring",
|
|
52
|
-
"zh-CN": "\u63D0\u4F9B TypeScript/JavaScript \u8BED\u8A00\u652F\u6301\uFF0C\u5305\u62EC\u667A\u80FD\u611F\u77E5\u3001\u9519\u8BEF\u68C0\u67E5\u548C\u91CD\u6784\u529F\u80FD"
|
|
53
|
-
},
|
|
54
|
-
type: "stdio",
|
|
55
|
-
command: "typescript-language-server",
|
|
56
|
-
args: ["--stdio"],
|
|
57
|
-
env: {},
|
|
58
|
-
requiredFor: ["typescript", "javascript", "react", "vue", "angular", "nextjs"],
|
|
59
|
-
optionalFor: ["nodejs", "web"],
|
|
60
|
-
installCheck: "typescript-language-server --version",
|
|
61
|
-
installCommand: "npm install -g typescript-language-server typescript",
|
|
62
|
-
category: "language",
|
|
63
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
64
|
-
requiredCommands: ["node", "npm"]
|
|
65
|
-
},
|
|
66
|
-
"python-lsp-server": {
|
|
67
|
-
id: "python-lsp-server",
|
|
68
|
-
name: {
|
|
69
|
-
"en": "Python LSP Server",
|
|
70
|
-
"zh-CN": "Python LSP \u670D\u52A1\u5668"
|
|
71
|
-
},
|
|
72
|
-
description: {
|
|
73
|
-
"en": "Python Language Server Protocol implementation with linting, formatting, and code completion",
|
|
74
|
-
"zh-CN": "Python \u8BED\u8A00\u670D\u52A1\u5668\u534F\u8BAE\u5B9E\u73B0\uFF0C\u63D0\u4F9B\u4EE3\u7801\u68C0\u67E5\u3001\u683C\u5F0F\u5316\u548C\u81EA\u52A8\u8865\u5168\u529F\u80FD"
|
|
75
|
-
},
|
|
76
|
-
type: "stdio",
|
|
77
|
-
command: "pylsp",
|
|
78
|
-
args: [],
|
|
79
|
-
env: {},
|
|
80
|
-
requiredFor: ["python", "django", "flask", "fastapi"],
|
|
81
|
-
optionalFor: ["data-science", "machine-learning"],
|
|
82
|
-
installCheck: "pylsp --version",
|
|
83
|
-
installCommand: "pip install python-lsp-server[all]",
|
|
84
|
-
category: "language",
|
|
85
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
86
|
-
requiredCommands: ["python", "pip"]
|
|
87
|
-
},
|
|
88
|
-
"gopls": {
|
|
89
|
-
id: "gopls",
|
|
90
|
-
name: {
|
|
91
|
-
"en": "Go Language Server",
|
|
92
|
-
"zh-CN": "Go \u8BED\u8A00\u670D\u52A1\u5668"
|
|
93
|
-
},
|
|
94
|
-
description: {
|
|
95
|
-
"en": "Official Go language server providing code intelligence, navigation, and refactoring",
|
|
96
|
-
"zh-CN": "\u5B98\u65B9 Go \u8BED\u8A00\u670D\u52A1\u5668\uFF0C\u63D0\u4F9B\u4EE3\u7801\u667A\u80FD\u3001\u5BFC\u822A\u548C\u91CD\u6784\u529F\u80FD"
|
|
97
|
-
},
|
|
98
|
-
type: "stdio",
|
|
99
|
-
command: "gopls",
|
|
100
|
-
args: [],
|
|
101
|
-
env: {},
|
|
102
|
-
requiredFor: ["go", "golang"],
|
|
103
|
-
optionalFor: ["microservices", "backend"],
|
|
104
|
-
installCheck: "gopls version",
|
|
105
|
-
installCommand: "go install golang.org/x/tools/gopls@latest",
|
|
106
|
-
category: "language",
|
|
107
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
108
|
-
requiredCommands: ["go"]
|
|
109
|
-
},
|
|
110
|
-
"rust-analyzer": {
|
|
111
|
-
id: "rust-analyzer",
|
|
112
|
-
name: {
|
|
113
|
-
"en": "Rust Analyzer",
|
|
114
|
-
"zh-CN": "Rust \u5206\u6790\u5668"
|
|
115
|
-
},
|
|
116
|
-
description: {
|
|
117
|
-
"en": "Fast and feature-rich language server for Rust with real-time diagnostics and code assistance",
|
|
118
|
-
"zh-CN": "\u5FEB\u901F\u4E14\u529F\u80FD\u4E30\u5BCC\u7684 Rust \u8BED\u8A00\u670D\u52A1\u5668\uFF0C\u63D0\u4F9B\u5B9E\u65F6\u8BCA\u65AD\u548C\u4EE3\u7801\u8F85\u52A9"
|
|
119
|
-
},
|
|
120
|
-
type: "stdio",
|
|
121
|
-
command: "rust-analyzer",
|
|
122
|
-
args: [],
|
|
123
|
-
env: {},
|
|
124
|
-
requiredFor: ["rust", "cargo"],
|
|
125
|
-
optionalFor: ["systems-programming", "webassembly"],
|
|
126
|
-
installCheck: "rust-analyzer --version",
|
|
127
|
-
installCommand: "rustup component add rust-analyzer",
|
|
128
|
-
category: "language",
|
|
129
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
130
|
-
requiredCommands: ["rustup", "cargo"]
|
|
131
|
-
},
|
|
132
|
-
// ============================================================================
|
|
133
|
-
// Development Tooling
|
|
134
|
-
// ============================================================================
|
|
135
|
-
"eslint-mcp": {
|
|
136
|
-
id: "eslint-mcp",
|
|
137
|
-
name: {
|
|
138
|
-
"en": "ESLint MCP Server",
|
|
139
|
-
"zh-CN": "ESLint MCP \u670D\u52A1\u5668"
|
|
140
|
-
},
|
|
141
|
-
description: {
|
|
142
|
-
"en": "JavaScript/TypeScript linting and code quality analysis through MCP protocol",
|
|
143
|
-
"zh-CN": "\u901A\u8FC7 MCP \u534F\u8BAE\u63D0\u4F9B JavaScript/TypeScript \u4EE3\u7801\u68C0\u67E5\u548C\u8D28\u91CF\u5206\u6790"
|
|
144
|
-
},
|
|
145
|
-
type: "stdio",
|
|
146
|
-
command: "npx",
|
|
147
|
-
args: ["-y", "@modelcontextprotocol/server-eslint@latest"],
|
|
148
|
-
env: {},
|
|
149
|
-
requiredFor: [],
|
|
150
|
-
optionalFor: ["javascript", "typescript", "react", "vue", "angular", "nodejs"],
|
|
151
|
-
installCheck: "npx @modelcontextprotocol/server-eslint@latest --version",
|
|
152
|
-
installCommand: "npm install -g @modelcontextprotocol/server-eslint",
|
|
153
|
-
category: "tooling",
|
|
154
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
155
|
-
requiredCommands: ["node", "npm"]
|
|
156
|
-
},
|
|
157
|
-
"prettier-mcp": {
|
|
158
|
-
id: "prettier-mcp",
|
|
159
|
-
name: {
|
|
160
|
-
"en": "Prettier MCP Server",
|
|
161
|
-
"zh-CN": "Prettier MCP \u670D\u52A1\u5668"
|
|
162
|
-
},
|
|
163
|
-
description: {
|
|
164
|
-
"en": "Code formatting service for multiple languages through MCP protocol",
|
|
165
|
-
"zh-CN": "\u901A\u8FC7 MCP \u534F\u8BAE\u4E3A\u591A\u79CD\u8BED\u8A00\u63D0\u4F9B\u4EE3\u7801\u683C\u5F0F\u5316\u670D\u52A1"
|
|
166
|
-
},
|
|
167
|
-
type: "stdio",
|
|
168
|
-
command: "npx",
|
|
169
|
-
args: ["-y", "@modelcontextprotocol/server-prettier@latest"],
|
|
170
|
-
env: {},
|
|
171
|
-
requiredFor: [],
|
|
172
|
-
optionalFor: ["javascript", "typescript", "html", "css", "json", "markdown", "yaml"],
|
|
173
|
-
installCheck: "npx @modelcontextprotocol/server-prettier@latest --version",
|
|
174
|
-
installCommand: "npm install -g @modelcontextprotocol/server-prettier",
|
|
175
|
-
category: "tooling",
|
|
176
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
177
|
-
requiredCommands: ["node", "npm"]
|
|
178
|
-
},
|
|
179
|
-
// ============================================================================
|
|
180
|
-
// Git Integration
|
|
181
|
-
// ============================================================================
|
|
182
|
-
"git-mcp": {
|
|
183
|
-
id: "git-mcp",
|
|
184
|
-
name: {
|
|
185
|
-
"en": "Git MCP Server",
|
|
186
|
-
"zh-CN": "Git MCP \u670D\u52A1\u5668"
|
|
187
|
-
},
|
|
188
|
-
description: {
|
|
189
|
-
"en": "Git repository operations and version control through MCP protocol",
|
|
190
|
-
"zh-CN": "\u901A\u8FC7 MCP \u534F\u8BAE\u63D0\u4F9B Git \u4ED3\u5E93\u64CD\u4F5C\u548C\u7248\u672C\u63A7\u5236\u529F\u80FD"
|
|
191
|
-
},
|
|
192
|
-
type: "stdio",
|
|
193
|
-
command: "npx",
|
|
194
|
-
args: ["-y", "@modelcontextprotocol/server-git@latest"],
|
|
195
|
-
env: {},
|
|
196
|
-
requiredFor: [],
|
|
197
|
-
optionalFor: ["all"],
|
|
198
|
-
installCheck: "npx @modelcontextprotocol/server-git@latest --version",
|
|
199
|
-
installCommand: "npm install -g @modelcontextprotocol/server-git",
|
|
200
|
-
category: "git",
|
|
201
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
202
|
-
requiredCommands: ["git", "node", "npm"]
|
|
203
|
-
},
|
|
204
|
-
// ============================================================================
|
|
205
|
-
// Testing Frameworks
|
|
206
|
-
// ============================================================================
|
|
207
|
-
"playwright-mcp": {
|
|
208
|
-
id: "playwright-mcp",
|
|
209
|
-
name: {
|
|
210
|
-
"en": "Playwright MCP Server",
|
|
211
|
-
"zh-CN": "Playwright MCP \u670D\u52A1\u5668"
|
|
212
|
-
},
|
|
213
|
-
description: {
|
|
214
|
-
"en": "End-to-end testing and browser automation through MCP protocol",
|
|
215
|
-
"zh-CN": "\u901A\u8FC7 MCP \u534F\u8BAE\u63D0\u4F9B\u7AEF\u5230\u7AEF\u6D4B\u8BD5\u548C\u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u529F\u80FD"
|
|
216
|
-
},
|
|
217
|
-
type: "stdio",
|
|
218
|
-
command: "npx",
|
|
219
|
-
args: ["-y", "@playwright/mcp-server@latest"],
|
|
220
|
-
env: {},
|
|
221
|
-
requiredFor: [],
|
|
222
|
-
optionalFor: ["testing", "e2e", "web", "automation"],
|
|
223
|
-
installCheck: "npx @playwright/mcp-server@latest --version",
|
|
224
|
-
installCommand: "npm install -g @playwright/mcp-server",
|
|
225
|
-
category: "testing",
|
|
226
|
-
platforms: ["windows", "macos", "linux"],
|
|
227
|
-
requiresGui: false,
|
|
228
|
-
// Can run headless
|
|
229
|
-
requiredCommands: ["node", "npm"]
|
|
230
|
-
},
|
|
231
|
-
// ============================================================================
|
|
232
|
-
// Browser Automation
|
|
233
|
-
// ============================================================================
|
|
234
|
-
"puppeteer-mcp": {
|
|
235
|
-
id: "puppeteer-mcp",
|
|
236
|
-
name: {
|
|
237
|
-
"en": "Puppeteer MCP Server",
|
|
238
|
-
"zh-CN": "Puppeteer MCP \u670D\u52A1\u5668"
|
|
239
|
-
},
|
|
240
|
-
description: {
|
|
241
|
-
"en": "Chrome/Chromium browser automation and web scraping through MCP protocol",
|
|
242
|
-
"zh-CN": "\u901A\u8FC7 MCP \u534F\u8BAE\u63D0\u4F9B Chrome/Chromium \u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u548C\u7F51\u9875\u6293\u53D6\u529F\u80FD"
|
|
243
|
-
},
|
|
244
|
-
type: "stdio",
|
|
245
|
-
command: "npx",
|
|
246
|
-
args: ["-y", "@modelcontextprotocol/server-puppeteer@latest"],
|
|
247
|
-
env: {},
|
|
248
|
-
requiredFor: [],
|
|
249
|
-
optionalFor: ["web-scraping", "automation", "testing"],
|
|
250
|
-
installCheck: "npx @modelcontextprotocol/server-puppeteer@latest --version",
|
|
251
|
-
installCommand: "npm install -g @modelcontextprotocol/server-puppeteer",
|
|
252
|
-
category: "browser",
|
|
253
|
-
platforms: ["windows", "macos", "linux"],
|
|
254
|
-
requiresGui: false,
|
|
255
|
-
// Can run headless
|
|
256
|
-
requiredCommands: ["node", "npm"]
|
|
257
|
-
},
|
|
258
|
-
// ============================================================================
|
|
259
|
-
// Additional Language Servers
|
|
260
|
-
// ============================================================================
|
|
261
|
-
"vscode-json-language-server": {
|
|
262
|
-
id: "vscode-json-language-server",
|
|
263
|
-
name: {
|
|
264
|
-
"en": "JSON Language Server",
|
|
265
|
-
"zh-CN": "JSON \u8BED\u8A00\u670D\u52A1\u5668"
|
|
266
|
-
},
|
|
267
|
-
description: {
|
|
268
|
-
"en": "JSON schema validation, completion, and formatting support",
|
|
269
|
-
"zh-CN": "\u63D0\u4F9B JSON \u6A21\u5F0F\u9A8C\u8BC1\u3001\u81EA\u52A8\u8865\u5168\u548C\u683C\u5F0F\u5316\u652F\u6301"
|
|
270
|
-
},
|
|
271
|
-
type: "stdio",
|
|
272
|
-
command: "vscode-json-language-server",
|
|
273
|
-
args: ["--stdio"],
|
|
274
|
-
env: {},
|
|
275
|
-
requiredFor: [],
|
|
276
|
-
optionalFor: ["json", "configuration", "api"],
|
|
277
|
-
installCheck: "vscode-json-language-server --version",
|
|
278
|
-
installCommand: "npm install -g vscode-langservers-extracted",
|
|
279
|
-
category: "language",
|
|
280
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
281
|
-
requiredCommands: ["node", "npm"]
|
|
282
|
-
},
|
|
283
|
-
"yaml-language-server": {
|
|
284
|
-
id: "yaml-language-server",
|
|
285
|
-
name: {
|
|
286
|
-
"en": "YAML Language Server",
|
|
287
|
-
"zh-CN": "YAML \u8BED\u8A00\u670D\u52A1\u5668"
|
|
288
|
-
},
|
|
289
|
-
description: {
|
|
290
|
-
"en": "YAML schema validation, completion, and syntax highlighting",
|
|
291
|
-
"zh-CN": "\u63D0\u4F9B YAML \u6A21\u5F0F\u9A8C\u8BC1\u3001\u81EA\u52A8\u8865\u5168\u548C\u8BED\u6CD5\u9AD8\u4EAE"
|
|
292
|
-
},
|
|
293
|
-
type: "stdio",
|
|
294
|
-
command: "yaml-language-server",
|
|
295
|
-
args: ["--stdio"],
|
|
296
|
-
env: {},
|
|
297
|
-
requiredFor: [],
|
|
298
|
-
optionalFor: ["yaml", "kubernetes", "docker-compose", "ci-cd"],
|
|
299
|
-
installCheck: "yaml-language-server --version",
|
|
300
|
-
installCommand: "npm install -g yaml-language-server",
|
|
301
|
-
category: "language",
|
|
302
|
-
platforms: ["windows", "macos", "linux", "wsl"],
|
|
303
|
-
requiredCommands: ["node", "npm"]
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
function isTemplateCompatible(template, platform) {
|
|
307
|
-
if (!template.platforms || template.platforms.length === 0) {
|
|
308
|
-
return true;
|
|
309
|
-
}
|
|
310
|
-
if (!platform) {
|
|
311
|
-
const process = globalThis.process;
|
|
312
|
-
if (!process)
|
|
313
|
-
return true;
|
|
314
|
-
const platformMap = {
|
|
315
|
-
win32: "windows",
|
|
316
|
-
darwin: "macos",
|
|
317
|
-
linux: "linux"
|
|
318
|
-
};
|
|
319
|
-
platform = platformMap[process.platform] || "linux";
|
|
320
|
-
if (platform === "linux" && process.env.WSL_DISTRO_NAME) {
|
|
321
|
-
platform = "wsl";
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return template.platforms.includes(platform);
|
|
325
|
-
}
|
|
326
|
-
function getCompatibleMcpServiceTemplates(platform) {
|
|
327
|
-
return Object.values(mcpServiceTemplates).filter(
|
|
328
|
-
(template) => isTemplateCompatible(template, platform)
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
const SERVICE_TIERS = {
|
|
333
|
-
core: ["typescript-language-server", "python-lsp-server", "gopls", "rust-analyzer"],
|
|
334
|
-
ondemand: ["eslint-mcp", "prettier-mcp", "git-mcp"],
|
|
335
|
-
scenario: ["playwright-mcp", "puppeteer-mcp"]
|
|
336
|
-
};
|
|
337
|
-
async function ccjkMcp(options = {}) {
|
|
338
|
-
const startTime = Date.now();
|
|
339
|
-
await ensureI18nInitialized();
|
|
340
|
-
if (options.lang) {
|
|
341
|
-
i18n.changeLanguage(options.lang);
|
|
342
|
-
}
|
|
343
|
-
const isZh = i18n.language === "zh-CN";
|
|
344
|
-
const projectPath = cwd();
|
|
345
|
-
const result = {
|
|
346
|
-
success: false,
|
|
347
|
-
project: {
|
|
348
|
-
type: "unknown",
|
|
349
|
-
languages: [],
|
|
350
|
-
frameworks: []
|
|
351
|
-
},
|
|
352
|
-
services: [],
|
|
353
|
-
installed: [],
|
|
354
|
-
skipped: [],
|
|
355
|
-
failed: [],
|
|
356
|
-
duration: 0,
|
|
357
|
-
configPath: join(CLAUDE_DIR, "mcp.json")
|
|
358
|
-
};
|
|
359
|
-
try {
|
|
360
|
-
consola.info(isZh ? "\u{1F50D} \u5206\u6790\u9879\u76EE\u4E2D..." : "\u{1F50D} Analyzing project...");
|
|
361
|
-
const analysis = await analyzeProject(projectPath, {
|
|
362
|
-
analyzeTransitiveDeps: false
|
|
363
|
-
// Use default maxFilesToScan of 10000 for better large project support
|
|
364
|
-
});
|
|
365
|
-
result.project.type = analysis.projectType;
|
|
366
|
-
result.project.languages = analysis.languages.map((l) => l.language);
|
|
367
|
-
result.project.frameworks = analysis.frameworks.map((f) => f.name);
|
|
368
|
-
if (!options.json) {
|
|
369
|
-
console.log("");
|
|
370
|
-
console.log(a.green(` ${isZh ? "\u68C0\u6D4B\u5230" : "Detected"}: ${a.bold(analysis.projectType)}`));
|
|
371
|
-
console.log(a.dim(` ${isZh ? "\u8BED\u8A00" : "Languages"}: ${analysis.languages.map((l) => l.language).join(", ")}`));
|
|
372
|
-
if (analysis.frameworks.length > 0) {
|
|
373
|
-
console.log(a.dim(` ${isZh ? "\u6846\u67B6" : "Frameworks"}: ${analysis.frameworks.map((f) => f.name).join(", ")}`));
|
|
374
|
-
}
|
|
375
|
-
console.log("");
|
|
376
|
-
}
|
|
377
|
-
const recommendedServices = await getRecommendedServices(analysis, options);
|
|
378
|
-
const availableServices = filterServicesByTier(recommendedServices, options.tier);
|
|
379
|
-
const selectedServices = filterServicesByExclusion(availableServices, options.exclude);
|
|
380
|
-
if (!options.json) {
|
|
381
|
-
console.log(a.bold.cyan(`${isZh ? "\u{1F527} \u63A8\u8350\u7684 MCP \u670D\u52A1" : "\u{1F527} Recommended MCP Services"} (${selectedServices.length} ${isZh ? "\u4E2A" : "found"}):
|
|
382
|
-
`));
|
|
383
|
-
const coreServices = selectedServices.filter((s) => SERVICE_TIERS.core.includes(s.id));
|
|
384
|
-
const ondemandServices = selectedServices.filter((s) => SERVICE_TIERS.ondemand.includes(s.id));
|
|
385
|
-
const scenarioServices = selectedServices.filter((s) => SERVICE_TIERS.scenario.includes(s.id));
|
|
386
|
-
if (coreServices.length > 0) {
|
|
387
|
-
console.log(a.bold(`${isZh ? "\u6838\u5FC3\u670D\u52A1" : "Core Services"}:`));
|
|
388
|
-
coreServices.forEach((service) => {
|
|
389
|
-
const installed = isServiceInstalled(service.id);
|
|
390
|
-
const status = installed ? a.green("\u2705") : a.yellow("\u2B55");
|
|
391
|
-
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
392
|
-
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
393
|
-
console.log(` ${status} ${a.bold(service.id.padEnd(30))} - ${desc}`);
|
|
394
|
-
});
|
|
395
|
-
console.log("");
|
|
396
|
-
}
|
|
397
|
-
if (ondemandServices.length > 0) {
|
|
398
|
-
console.log(a.bold(`${isZh ? "\u6309\u9700\u670D\u52A1" : "On-Demand Services"}:`));
|
|
399
|
-
ondemandServices.forEach((service) => {
|
|
400
|
-
const installed = isServiceInstalled(service.id);
|
|
401
|
-
const status = installed ? a.green("\u2705") : a.yellow("\u2B55");
|
|
402
|
-
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
403
|
-
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
404
|
-
console.log(` ${status} ${a.bold(service.id.padEnd(30))} - ${desc}`);
|
|
405
|
-
});
|
|
406
|
-
console.log("");
|
|
407
|
-
}
|
|
408
|
-
if (scenarioServices.length > 0) {
|
|
409
|
-
console.log(a.bold(`${isZh ? "\u573A\u666F\u670D\u52A1" : "Scenario Services"}:`));
|
|
410
|
-
scenarioServices.forEach((service) => {
|
|
411
|
-
const installed = isServiceInstalled(service.id);
|
|
412
|
-
const status = installed ? a.green("\u2705") : a.yellow("\u2B55");
|
|
413
|
-
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
414
|
-
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
415
|
-
console.log(` ${status} ${a.bold(service.id.padEnd(30))} - ${desc}`);
|
|
416
|
-
});
|
|
417
|
-
console.log("");
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
let servicesToInstall = selectedServices;
|
|
421
|
-
if (options.interactive !== false && !options.json) {
|
|
422
|
-
const { confirm } = await inquirer.prompt([{
|
|
423
|
-
type: "confirm",
|
|
424
|
-
name: "confirm",
|
|
425
|
-
message: `${isZh ? "\u5B89\u88C5\u63A8\u8350\u670D\u52A1" : "Install recommended services"}?`,
|
|
426
|
-
default: true
|
|
427
|
-
}]);
|
|
428
|
-
if (!confirm) {
|
|
429
|
-
consola.warn(isZh ? "\u64CD\u4F5C\u5DF2\u53D6\u6D88" : "Operation cancelled");
|
|
430
|
-
result.success = true;
|
|
431
|
-
result.duration = Date.now() - startTime;
|
|
432
|
-
return result;
|
|
433
|
-
}
|
|
434
|
-
const { selected } = await inquirer.prompt([{
|
|
435
|
-
type: "checkbox",
|
|
436
|
-
name: "selected",
|
|
437
|
-
message: isZh ? "\u9009\u62E9\u8981\u5B89\u88C5\u7684\u670D\u52A1" : "Select services to install",
|
|
438
|
-
choices: selectedServices.map((s) => ({
|
|
439
|
-
name: `${s.id} - ${isZh ? s.name["zh-CN"] : s.name.en}`,
|
|
440
|
-
value: s.id,
|
|
441
|
-
checked: true
|
|
442
|
-
}))
|
|
443
|
-
}]);
|
|
444
|
-
servicesToInstall = selectedServices.filter((s) => selected.includes(s.id));
|
|
445
|
-
}
|
|
446
|
-
const alreadyInstalled = [];
|
|
447
|
-
if (!options.force) {
|
|
448
|
-
servicesToInstall = servicesToInstall.filter((s) => {
|
|
449
|
-
const installed = isServiceInstalled(s.id);
|
|
450
|
-
if (installed) {
|
|
451
|
-
alreadyInstalled.push(s.id);
|
|
452
|
-
}
|
|
453
|
-
return !installed;
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
result.skipped.push(...alreadyInstalled);
|
|
457
|
-
if (servicesToInstall.length === 0) {
|
|
458
|
-
if (!options.json) {
|
|
459
|
-
console.log(a.green(isZh ? "\u2705 \u6240\u6709\u670D\u52A1\u5DF2\u5B89\u88C5" : "\u2705 All services already installed"));
|
|
460
|
-
}
|
|
461
|
-
result.success = true;
|
|
462
|
-
result.duration = Date.now() - startTime;
|
|
463
|
-
return result;
|
|
464
|
-
}
|
|
465
|
-
if (options.dryRun) {
|
|
466
|
-
if (!options.json) {
|
|
467
|
-
console.log(a.yellow(isZh ? "\n\u{1F50D} Dry run \u6A21\u5F0F - \u9884\u89C8\u5B89\u88C5\u8BA1\u5212" : "\n\u{1F50D} Dry run mode - Installation preview"));
|
|
468
|
-
console.log("");
|
|
469
|
-
servicesToInstall.forEach((service) => {
|
|
470
|
-
const name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
471
|
-
console.log(` \u2022 ${service.id} (${name})`);
|
|
472
|
-
});
|
|
473
|
-
console.log("");
|
|
474
|
-
}
|
|
475
|
-
result.success = true;
|
|
476
|
-
result.duration = Date.now() - startTime;
|
|
477
|
-
return result;
|
|
478
|
-
}
|
|
479
|
-
if (!options.json) {
|
|
480
|
-
console.log(a.bold.cyan(`${isZh ? "\u{1F4E6} \u5B89\u88C5\u4F9D\u8D56\u4E2D..." : "\u{1F4E6} Installing dependencies..."}
|
|
481
|
-
`));
|
|
482
|
-
}
|
|
483
|
-
for (const service of servicesToInstall) {
|
|
484
|
-
const installResult = await installServiceDependencies(service, options);
|
|
485
|
-
result.services.push(installResult);
|
|
486
|
-
if (installResult.status === "installed") {
|
|
487
|
-
result.installed.push(service.id);
|
|
488
|
-
} else if (installResult.status === "skipped") {
|
|
489
|
-
result.skipped.push(service.id);
|
|
490
|
-
} else {
|
|
491
|
-
result.failed.push(service.id);
|
|
492
|
-
}
|
|
493
|
-
if (!options.json) {
|
|
494
|
-
const status = installResult.status === "installed" ? a.green("\u2713") : installResult.status === "skipped" ? a.yellow("\u25CB") : a.red("\u2717");
|
|
495
|
-
const name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
496
|
-
console.log(` ${status} ${service.id} (${name})`);
|
|
497
|
-
if (installResult.error) {
|
|
498
|
-
console.log(a.red(` ${installResult.error}`));
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
if (result.installed.length > 0) {
|
|
503
|
-
if (!options.json) {
|
|
504
|
-
console.log("");
|
|
505
|
-
console.log(a.bold.cyan(`${isZh ? "\u2699\uFE0F \u914D\u7F6E MCP \u670D\u52A1\u4E2D..." : "\u2699\uFE0F Configuring MCP services..."}
|
|
506
|
-
`));
|
|
507
|
-
}
|
|
508
|
-
backupMcpConfig();
|
|
509
|
-
const config = readMcpConfig() || { mcpServers: {} };
|
|
510
|
-
const newServers = {};
|
|
511
|
-
for (const serviceId of result.installed) {
|
|
512
|
-
const service = mcpServiceTemplates[serviceId] || servicesToInstall.find((s) => s.id === serviceId);
|
|
513
|
-
if (service) {
|
|
514
|
-
newServers[serviceId] = {
|
|
515
|
-
type: service.type,
|
|
516
|
-
command: service.command,
|
|
517
|
-
args: service.args,
|
|
518
|
-
env: service.env
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
const mergedConfig = mergeMcpServers(config, newServers);
|
|
523
|
-
writeMcpConfig(mergedConfig);
|
|
524
|
-
if (!options.json) {
|
|
525
|
-
result.installed.forEach((serviceId) => {
|
|
526
|
-
const service = mcpServiceTemplates[serviceId] || servicesToInstall.find((s) => s.id === serviceId);
|
|
527
|
-
const name = service ? isZh ? service.name["zh-CN"] : service.name.en : serviceId;
|
|
528
|
-
console.log(` ${a.green("\u2713")} ${serviceId} (${name})`);
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
if (!options.skipVerification && result.installed.length > 0) {
|
|
533
|
-
if (!options.json) {
|
|
534
|
-
console.log("");
|
|
535
|
-
console.log(a.bold.cyan(`${isZh ? "\u{1F50D} \u9A8C\u8BC1\u670D\u52A1..." : "\u{1F50D} Verifying services..."}
|
|
536
|
-
`));
|
|
537
|
-
}
|
|
538
|
-
for (const serviceId of result.installed) {
|
|
539
|
-
const service = mcpServiceTemplates[serviceId] || servicesToInstall.find((s) => s.id === serviceId);
|
|
540
|
-
const verified = service ? await verifyService(service) : false;
|
|
541
|
-
if (!options.json) {
|
|
542
|
-
const name = service ? isZh ? service.name["zh-CN"] : service.name.en : serviceId;
|
|
543
|
-
const status = verified ? a.green("\u2713") : a.red("\u2717");
|
|
544
|
-
console.log(` ${status} ${serviceId} (${name})`);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
result.success = result.failed.length === 0;
|
|
549
|
-
if (!options.json) {
|
|
550
|
-
console.log("");
|
|
551
|
-
if (result.success) {
|
|
552
|
-
console.log(a.green.bold(`${isZh ? `\u2705 \u6210\u529F\u914D\u7F6E ${result.installed.length} \u4E2A MCP \u670D\u52A1\uFF01` : `\u2705 Successfully configured ${result.installed.length} MCP service(s)!`}`));
|
|
553
|
-
} else {
|
|
554
|
-
console.log(a.yellow.bold(`${isZh ? `\u26A0\uFE0F \u90E8\u5206\u670D\u52A1\u914D\u7F6E\u5931\u8D25` : `\u26A0\uFE0F Some services failed to configure`}`));
|
|
555
|
-
}
|
|
556
|
-
console.log("");
|
|
557
|
-
console.log(a.bold(isZh ? "\u4E0B\u4E00\u6B65:" : "Next steps:"));
|
|
558
|
-
console.log(` \u2022 ${isZh ? "\u4F7F\u7528 /ccjk:skills \u5B89\u88C5\u6280\u80FD" : "Use /ccjk:skills to install skills"}`);
|
|
559
|
-
console.log(` \u2022 ${isZh ? "\u4F7F\u7528 /ccjk:agents \u521B\u5EFA\u4EE3\u7406" : "Use /ccjk:agents to create agents"}`);
|
|
560
|
-
console.log(` \u2022 ${isZh ? "\u91CD\u542F Claude Code \u4EE5\u5E94\u7528\u66F4\u6539" : "Restart Claude Code to apply changes"}`);
|
|
561
|
-
console.log("");
|
|
562
|
-
}
|
|
563
|
-
result.duration = Date.now() - startTime;
|
|
564
|
-
return result;
|
|
565
|
-
} catch (error) {
|
|
566
|
-
consola.error(isZh ? "MCP \u670D\u52A1\u914D\u7F6E\u5931\u8D25" : "MCP service configuration failed", error);
|
|
567
|
-
result.success = false;
|
|
568
|
-
result.duration = Date.now() - startTime;
|
|
569
|
-
return result;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
async function getRecommendedServices(analysis, options) {
|
|
573
|
-
const services = [];
|
|
574
|
-
const projectType = analysis.projectType.toLowerCase();
|
|
575
|
-
const languages = analysis.languages.map((l) => l.language.toLowerCase());
|
|
576
|
-
const frameworks = analysis.frameworks.map((f) => f.name.toLowerCase());
|
|
577
|
-
const isZh = i18n.language === "zh-CN";
|
|
578
|
-
try {
|
|
579
|
-
const templatesClient = getTemplatesClient({ language: isZh ? "zh-CN" : "en" });
|
|
580
|
-
const cloudMcpServices = await templatesClient.getOfficialMcpServers();
|
|
581
|
-
if (cloudMcpServices.length > 0) {
|
|
582
|
-
consola.success(isZh ? `\u4ECE\u4E91\u7AEF\u83B7\u53D6 ${cloudMcpServices.length} \u4E2A MCP \u670D\u52A1` : `Fetched ${cloudMcpServices.length} MCP services from cloud`);
|
|
583
|
-
const relevantServices = cloudMcpServices.filter((mcp) => {
|
|
584
|
-
const tags = mcp.tags || [];
|
|
585
|
-
const category = mcp.category || "";
|
|
586
|
-
const compatibility = mcp.compatibility || {};
|
|
587
|
-
return tags.some((tag) => languages.includes(tag) || frameworks.includes(tag) || projectType.includes(tag)) || (compatibility.languages || []).some((lang) => languages.includes(lang.toLowerCase())) || (compatibility.frameworks || []).some((fw) => frameworks.includes(fw.toLowerCase())) || category === "core";
|
|
588
|
-
});
|
|
589
|
-
for (const mcp of relevantServices.length > 0 ? relevantServices : cloudMcpServices.slice(0, 10)) {
|
|
590
|
-
const localTemplate = mcpServiceTemplates[mcp.id] || mcpServiceTemplates[mcp.name_en.toLowerCase().replace(/\s+/g, "-")];
|
|
591
|
-
if (localTemplate) {
|
|
592
|
-
services.push(localTemplate);
|
|
593
|
-
} else {
|
|
594
|
-
const cloudTemplate = {
|
|
595
|
-
id: mcp.id || mcp.name_en.toLowerCase().replace(/\s+/g, "-"),
|
|
596
|
-
name: {
|
|
597
|
-
"en": mcp.name_en,
|
|
598
|
-
"zh-CN": mcp.name_zh_cn || mcp.name_en
|
|
599
|
-
},
|
|
600
|
-
description: {
|
|
601
|
-
"en": mcp.description_en || "",
|
|
602
|
-
"zh-CN": mcp.description_zh_cn || mcp.description_en || ""
|
|
603
|
-
},
|
|
604
|
-
type: "stdio",
|
|
605
|
-
command: mcp.npm_package ? "npx" : "node",
|
|
606
|
-
args: mcp.npm_package ? ["-y", mcp.npm_package] : [],
|
|
607
|
-
installCommand: mcp.install_command || `npm install -g ${mcp.npm_package || mcp.id}`,
|
|
608
|
-
installCheck: mcp.npm_package ? `npx ${mcp.npm_package} --version` : "echo ok",
|
|
609
|
-
category: "tooling",
|
|
610
|
-
requiredFor: [],
|
|
611
|
-
optionalFor: ["all"],
|
|
612
|
-
env: {}
|
|
613
|
-
};
|
|
614
|
-
services.push(cloudTemplate);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
if (services.length > 0) {
|
|
618
|
-
return services;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
} catch (_error) {
|
|
622
|
-
consola.warn(isZh ? "\u4E91\u7AEF\u83B7\u53D6\u5931\u8D25\uFF0C\u4F7F\u7528\u672C\u5730\u6A21\u677F" : "Cloud fetch failed, using local templates");
|
|
623
|
-
}
|
|
624
|
-
const allServices = getCompatibleMcpServiceTemplates();
|
|
625
|
-
for (const service of allServices) {
|
|
626
|
-
if (options.services && options.services.length > 0) {
|
|
627
|
-
if (options.services.includes(service.id)) {
|
|
628
|
-
services.push(service);
|
|
629
|
-
}
|
|
630
|
-
continue;
|
|
631
|
-
}
|
|
632
|
-
if (options.exclude && options.exclude.includes(service.id)) {
|
|
633
|
-
continue;
|
|
634
|
-
}
|
|
635
|
-
if (service.requiredFor.includes(projectType) || service.requiredFor.includes("all")) {
|
|
636
|
-
services.push(service);
|
|
637
|
-
continue;
|
|
638
|
-
}
|
|
639
|
-
if (service.optionalFor.includes(projectType) || service.optionalFor.includes("all")) {
|
|
640
|
-
services.push(service);
|
|
641
|
-
continue;
|
|
642
|
-
}
|
|
643
|
-
for (const lang of languages) {
|
|
644
|
-
if (service.requiredFor.includes(lang) || service.optionalFor.includes(lang)) {
|
|
645
|
-
services.push(service);
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
const uniqueServices = Array.from(
|
|
651
|
-
new Map(services.map((s) => [s.id, s])).values()
|
|
652
|
-
);
|
|
653
|
-
return uniqueServices;
|
|
654
|
-
}
|
|
655
|
-
function filterServicesByTier(services, tier) {
|
|
656
|
-
if (!tier || tier === "all") {
|
|
657
|
-
return services;
|
|
658
|
-
}
|
|
659
|
-
const tierServices = SERVICE_TIERS[tier];
|
|
660
|
-
return services.filter((s) => tierServices.includes(s.id));
|
|
661
|
-
}
|
|
662
|
-
function filterServicesByExclusion(services, exclude) {
|
|
663
|
-
if (!exclude || exclude.length === 0) {
|
|
664
|
-
return services;
|
|
665
|
-
}
|
|
666
|
-
return services.filter((s) => !exclude.includes(s.id));
|
|
667
|
-
}
|
|
668
|
-
function isServiceInstalled(serviceId) {
|
|
669
|
-
const config = readMcpConfig();
|
|
670
|
-
return config?.mcpServers?.[serviceId] !== void 0;
|
|
671
|
-
}
|
|
672
|
-
async function installServiceDependencies(service, options) {
|
|
673
|
-
const result = {
|
|
674
|
-
id: service.id,
|
|
675
|
-
name: i18n.language === "zh-CN" ? service.name["zh-CN"] : service.name.en,
|
|
676
|
-
status: "installed"
|
|
677
|
-
};
|
|
678
|
-
try {
|
|
679
|
-
if (isServiceInstalled(service.id) && !options.force) {
|
|
680
|
-
result.status = "skipped";
|
|
681
|
-
return result;
|
|
682
|
-
}
|
|
683
|
-
const commandExists2 = await checkCommandExists(service.command);
|
|
684
|
-
if (commandExists2) {
|
|
685
|
-
result.dependenciesInstalled = false;
|
|
686
|
-
return result;
|
|
687
|
-
}
|
|
688
|
-
if (options.autoInstall) {
|
|
689
|
-
consola.info(`Installing ${service.id}...`);
|
|
690
|
-
const { exec } = await import('./main.mjs');
|
|
691
|
-
const [cmd, ...args] = service.installCommand.split(" ");
|
|
692
|
-
await exec(cmd, args);
|
|
693
|
-
result.dependenciesInstalled = true;
|
|
694
|
-
} else {
|
|
695
|
-
result.status = "skipped";
|
|
696
|
-
result.error = i18n.language === "zh-CN" ? "\u4F9D\u8D56\u672A\u5B89\u88C5\uFF0C\u4F7F\u7528 --auto-install \u81EA\u52A8\u5B89\u88C5" : "Dependencies not installed, use --auto-install to install automatically";
|
|
697
|
-
}
|
|
698
|
-
return result;
|
|
699
|
-
} catch (error) {
|
|
700
|
-
result.status = "failed";
|
|
701
|
-
result.error = error instanceof Error ? error.message : String(error);
|
|
702
|
-
return result;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
async function checkCommandExists(command) {
|
|
706
|
-
try {
|
|
707
|
-
const cmdName = command.split(" ")[0];
|
|
708
|
-
return commandExists(cmdName);
|
|
709
|
-
} catch {
|
|
710
|
-
return false;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
async function verifyService(service) {
|
|
714
|
-
try {
|
|
715
|
-
const { exec } = await import('./main.mjs');
|
|
716
|
-
const [cmd, ...args] = service.installCheck.split(" ");
|
|
717
|
-
const result = await exec(cmd, args, { timeout: 5e3 });
|
|
718
|
-
return result.exitCode === 0;
|
|
719
|
-
} catch {
|
|
720
|
-
return false;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
function formatResultAsJson(result) {
|
|
724
|
-
return JSON.stringify(result, null, 2);
|
|
725
|
-
}
|
|
726
|
-
function formatResultForConsole(result) {
|
|
727
|
-
const isZh = i18n.language === "zh-CN";
|
|
728
|
-
const lines = [];
|
|
729
|
-
lines.push(a.bold.cyan(isZh ? "\u{1F4CA} MCP \u670D\u52A1\u914D\u7F6E\u6458\u8981" : "\u{1F4CA} MCP Service Configuration Summary"));
|
|
730
|
-
lines.push("");
|
|
731
|
-
lines.push(`${a.bold(isZh ? "\u9879\u76EE\u7C7B\u578B" : "Project Type")}: ${result.project.type}`);
|
|
732
|
-
lines.push(`${a.bold(isZh ? "\u8BED\u8A00" : "Languages")}: ${result.project.languages.join(", ")}`);
|
|
733
|
-
if (result.project.frameworks.length > 0) {
|
|
734
|
-
lines.push(`${a.bold(isZh ? "\u6846\u67B6" : "Frameworks")}: ${result.project.frameworks.join(", ")}`);
|
|
735
|
-
}
|
|
736
|
-
lines.push("");
|
|
737
|
-
lines.push(a.bold(isZh ? "\u5B89\u88C5\u7684\u670D\u52A1" : "Installed Services"));
|
|
738
|
-
result.installed.forEach((id) => {
|
|
739
|
-
lines.push(` ${a.green("\u2713")} ${id}`);
|
|
740
|
-
});
|
|
741
|
-
lines.push("");
|
|
742
|
-
if (result.skipped.length > 0) {
|
|
743
|
-
lines.push(a.bold(isZh ? "\u8DF3\u8FC7\u7684\u670D\u52A1" : "Skipped Services"));
|
|
744
|
-
result.skipped.forEach((id) => {
|
|
745
|
-
lines.push(` ${a.yellow("\u25CB")} ${id}`);
|
|
746
|
-
});
|
|
747
|
-
lines.push("");
|
|
748
|
-
}
|
|
749
|
-
if (result.failed.length > 0) {
|
|
750
|
-
lines.push(a.bold(isZh ? "\u5931\u8D25\u7684\u670D\u52A1" : "Failed Services"));
|
|
751
|
-
result.failed.forEach((id) => {
|
|
752
|
-
lines.push(` ${a.red("\u2717")} ${id}`);
|
|
753
|
-
});
|
|
754
|
-
lines.push("");
|
|
755
|
-
}
|
|
756
|
-
lines.push(`${a.bold(isZh ? "\u8017\u65F6" : "Duration")}: ${result.duration}ms`);
|
|
757
|
-
lines.push(`${a.bold(isZh ? "\u914D\u7F6E\u6587\u4EF6" : "Config File")}: ${result.configPath}`);
|
|
758
|
-
return lines.join("\n");
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
export { ccjkMcp, formatResultAsJson, formatResultForConsole };
|