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
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import process__default from 'node:process';
|
|
3
|
-
import { j as join } from './ccjk.bQ7Dh1g4.mjs';
|
|
4
|
-
|
|
5
|
-
function readPackageJson(dir) {
|
|
6
|
-
const pkgPath = join(dir, "package.json");
|
|
7
|
-
if (!existsSync(pkgPath))
|
|
8
|
-
return null;
|
|
9
|
-
try {
|
|
10
|
-
return JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
11
|
-
} catch {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function detectPackageManager(dir) {
|
|
16
|
-
if (existsSync(join(dir, "bun.lockb")))
|
|
17
|
-
return "bun";
|
|
18
|
-
if (existsSync(join(dir, "pnpm-lock.yaml")))
|
|
19
|
-
return "pnpm";
|
|
20
|
-
if (existsSync(join(dir, "yarn.lock")))
|
|
21
|
-
return "yarn";
|
|
22
|
-
if (existsSync(join(dir, "package-lock.json")))
|
|
23
|
-
return "npm";
|
|
24
|
-
const pkg = readPackageJson(dir);
|
|
25
|
-
if (pkg?.packageManager) {
|
|
26
|
-
if (pkg.packageManager.startsWith("pnpm"))
|
|
27
|
-
return "pnpm";
|
|
28
|
-
if (pkg.packageManager.startsWith("yarn"))
|
|
29
|
-
return "yarn";
|
|
30
|
-
if (pkg.packageManager.startsWith("bun"))
|
|
31
|
-
return "bun";
|
|
32
|
-
}
|
|
33
|
-
return "unknown";
|
|
34
|
-
}
|
|
35
|
-
function detectFrameworks(dir) {
|
|
36
|
-
const frameworks = [];
|
|
37
|
-
const pkg = readPackageJson(dir);
|
|
38
|
-
if (!pkg)
|
|
39
|
-
return frameworks;
|
|
40
|
-
const allDeps = {
|
|
41
|
-
...pkg.dependencies,
|
|
42
|
-
...pkg.devDependencies
|
|
43
|
-
};
|
|
44
|
-
if (allDeps.react)
|
|
45
|
-
frameworks.push("react");
|
|
46
|
-
if (allDeps.vue)
|
|
47
|
-
frameworks.push("vue");
|
|
48
|
-
if (allDeps["@angular/core"])
|
|
49
|
-
frameworks.push("angular");
|
|
50
|
-
if (allDeps.svelte)
|
|
51
|
-
frameworks.push("svelte");
|
|
52
|
-
if (allDeps.next)
|
|
53
|
-
frameworks.push("nextjs");
|
|
54
|
-
if (allDeps.nuxt)
|
|
55
|
-
frameworks.push("nuxt");
|
|
56
|
-
if (allDeps["@remix-run/react"])
|
|
57
|
-
frameworks.push("remix");
|
|
58
|
-
if (allDeps.astro)
|
|
59
|
-
frameworks.push("astro");
|
|
60
|
-
if (allDeps.express)
|
|
61
|
-
frameworks.push("express");
|
|
62
|
-
if (allDeps.fastify)
|
|
63
|
-
frameworks.push("fastify");
|
|
64
|
-
if (allDeps["@nestjs/core"])
|
|
65
|
-
frameworks.push("nestjs");
|
|
66
|
-
if (allDeps.koa)
|
|
67
|
-
frameworks.push("koa");
|
|
68
|
-
if (allDeps.hono)
|
|
69
|
-
frameworks.push("hono");
|
|
70
|
-
if (allDeps.electron)
|
|
71
|
-
frameworks.push("electron");
|
|
72
|
-
if (allDeps["@tauri-apps/api"])
|
|
73
|
-
frameworks.push("tauri");
|
|
74
|
-
if (allDeps["react-native"])
|
|
75
|
-
frameworks.push("react-native");
|
|
76
|
-
if (existsSync(join(dir, "requirements.txt")) || existsSync(join(dir, "pyproject.toml"))) {
|
|
77
|
-
const reqPath = join(dir, "requirements.txt");
|
|
78
|
-
if (existsSync(reqPath)) {
|
|
79
|
-
const reqs = readFileSync(reqPath, "utf-8").toLowerCase();
|
|
80
|
-
if (reqs.includes("django"))
|
|
81
|
-
frameworks.push("django");
|
|
82
|
-
if (reqs.includes("flask"))
|
|
83
|
-
frameworks.push("flask");
|
|
84
|
-
if (reqs.includes("fastapi"))
|
|
85
|
-
frameworks.push("fastapi");
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (existsSync(join(dir, "Gemfile"))) {
|
|
89
|
-
const gemfile = readFileSync(join(dir, "Gemfile"), "utf-8").toLowerCase();
|
|
90
|
-
if (gemfile.includes("rails"))
|
|
91
|
-
frameworks.push("rails");
|
|
92
|
-
}
|
|
93
|
-
if (existsSync(join(dir, "composer.json"))) {
|
|
94
|
-
try {
|
|
95
|
-
const composer = JSON.parse(readFileSync(join(dir, "composer.json"), "utf-8"));
|
|
96
|
-
if (composer.require?.["laravel/framework"])
|
|
97
|
-
frameworks.push("laravel");
|
|
98
|
-
} catch {
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return frameworks;
|
|
102
|
-
}
|
|
103
|
-
function detectBuildTools(dir) {
|
|
104
|
-
const tools = [];
|
|
105
|
-
const pkg = readPackageJson(dir);
|
|
106
|
-
if (existsSync(join(dir, "vite.config.ts")) || existsSync(join(dir, "vite.config.js")))
|
|
107
|
-
tools.push("vite");
|
|
108
|
-
if (existsSync(join(dir, "webpack.config.js")) || existsSync(join(dir, "webpack.config.ts")))
|
|
109
|
-
tools.push("webpack");
|
|
110
|
-
if (existsSync(join(dir, "rollup.config.js")) || existsSync(join(dir, "rollup.config.ts")))
|
|
111
|
-
tools.push("rollup");
|
|
112
|
-
if (existsSync(join(dir, "tsup.config.ts")) || existsSync(join(dir, "tsup.config.js")))
|
|
113
|
-
tools.push("tsup");
|
|
114
|
-
if (pkg) {
|
|
115
|
-
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
116
|
-
if (allDeps.esbuild)
|
|
117
|
-
tools.push("esbuild");
|
|
118
|
-
if (allDeps["@swc/core"])
|
|
119
|
-
tools.push("swc");
|
|
120
|
-
if (allDeps.turbo)
|
|
121
|
-
tools.push("turbopack");
|
|
122
|
-
if (allDeps.parcel)
|
|
123
|
-
tools.push("parcel");
|
|
124
|
-
if (allDeps.unbuild)
|
|
125
|
-
tools.push("unbuild");
|
|
126
|
-
}
|
|
127
|
-
return tools;
|
|
128
|
-
}
|
|
129
|
-
function detectTestFrameworks(dir) {
|
|
130
|
-
const frameworks = [];
|
|
131
|
-
const pkg = readPackageJson(dir);
|
|
132
|
-
if (existsSync(join(dir, "vitest.config.ts")) || existsSync(join(dir, "vitest.config.js")))
|
|
133
|
-
frameworks.push("vitest");
|
|
134
|
-
if (existsSync(join(dir, "jest.config.js")) || existsSync(join(dir, "jest.config.ts")))
|
|
135
|
-
frameworks.push("jest");
|
|
136
|
-
if (existsSync(join(dir, "cypress.config.ts")) || existsSync(join(dir, "cypress.config.js")))
|
|
137
|
-
frameworks.push("cypress");
|
|
138
|
-
if (existsSync(join(dir, "playwright.config.ts")))
|
|
139
|
-
frameworks.push("playwright");
|
|
140
|
-
if (existsSync(join(dir, "pytest.ini")) || existsSync(join(dir, "conftest.py")))
|
|
141
|
-
frameworks.push("pytest");
|
|
142
|
-
if (pkg) {
|
|
143
|
-
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
144
|
-
if (allDeps.vitest && !frameworks.includes("vitest"))
|
|
145
|
-
frameworks.push("vitest");
|
|
146
|
-
if (allDeps.jest && !frameworks.includes("jest"))
|
|
147
|
-
frameworks.push("jest");
|
|
148
|
-
if (allDeps.mocha)
|
|
149
|
-
frameworks.push("mocha");
|
|
150
|
-
if (allDeps.cypress && !frameworks.includes("cypress"))
|
|
151
|
-
frameworks.push("cypress");
|
|
152
|
-
if (allDeps["@playwright/test"] && !frameworks.includes("playwright"))
|
|
153
|
-
frameworks.push("playwright");
|
|
154
|
-
}
|
|
155
|
-
return frameworks;
|
|
156
|
-
}
|
|
157
|
-
function detectCICDSystems(dir) {
|
|
158
|
-
const systems = [];
|
|
159
|
-
if (existsSync(join(dir, ".github", "workflows")))
|
|
160
|
-
systems.push("github-actions");
|
|
161
|
-
if (existsSync(join(dir, ".gitlab-ci.yml")))
|
|
162
|
-
systems.push("gitlab-ci");
|
|
163
|
-
if (existsSync(join(dir, "Jenkinsfile")))
|
|
164
|
-
systems.push("jenkins");
|
|
165
|
-
if (existsSync(join(dir, ".circleci")))
|
|
166
|
-
systems.push("circleci");
|
|
167
|
-
if (existsSync(join(dir, ".travis.yml")))
|
|
168
|
-
systems.push("travis");
|
|
169
|
-
if (existsSync(join(dir, "azure-pipelines.yml")))
|
|
170
|
-
systems.push("azure-pipelines");
|
|
171
|
-
return systems;
|
|
172
|
-
}
|
|
173
|
-
function detectLanguages(dir) {
|
|
174
|
-
const languages = [];
|
|
175
|
-
if (existsSync(join(dir, "tsconfig.json")))
|
|
176
|
-
languages.push("typescript");
|
|
177
|
-
if (existsSync(join(dir, "package.json"))) {
|
|
178
|
-
if (!languages.includes("typescript"))
|
|
179
|
-
languages.push("javascript");
|
|
180
|
-
}
|
|
181
|
-
if (existsSync(join(dir, "requirements.txt")) || existsSync(join(dir, "pyproject.toml")) || existsSync(join(dir, "setup.py")))
|
|
182
|
-
languages.push("python");
|
|
183
|
-
if (existsSync(join(dir, "Gemfile")))
|
|
184
|
-
languages.push("ruby");
|
|
185
|
-
if (existsSync(join(dir, "go.mod")))
|
|
186
|
-
languages.push("go");
|
|
187
|
-
if (existsSync(join(dir, "Cargo.toml")))
|
|
188
|
-
languages.push("rust");
|
|
189
|
-
if (existsSync(join(dir, "pom.xml")) || existsSync(join(dir, "build.gradle"))) {
|
|
190
|
-
languages.push("java");
|
|
191
|
-
if (existsSync(join(dir, "build.gradle.kts")))
|
|
192
|
-
languages.push("kotlin");
|
|
193
|
-
}
|
|
194
|
-
if (existsSync(join(dir, "composer.json")))
|
|
195
|
-
languages.push("php");
|
|
196
|
-
if (existsSync(join(dir, "Package.swift")))
|
|
197
|
-
languages.push("swift");
|
|
198
|
-
if (existsSync(join(dir, "pubspec.yaml")))
|
|
199
|
-
languages.push("dart");
|
|
200
|
-
return languages;
|
|
201
|
-
}
|
|
202
|
-
function determineProjectType(info) {
|
|
203
|
-
const frameworks = info.frameworks || [];
|
|
204
|
-
if (frameworks.includes("react-native") || frameworks.includes("flutter"))
|
|
205
|
-
return "mobile";
|
|
206
|
-
if (frameworks.includes("electron") || frameworks.includes("tauri"))
|
|
207
|
-
return "desktop";
|
|
208
|
-
const pkg = info.rootDir ? readPackageJson(info.rootDir) : null;
|
|
209
|
-
if (pkg?.bin)
|
|
210
|
-
return "cli";
|
|
211
|
-
if (pkg?.main || pkg?.exports) {
|
|
212
|
-
const hasAppFramework = frameworks.some(
|
|
213
|
-
(f) => ["react", "vue", "angular", "svelte", "nextjs", "nuxt", "express", "fastify", "nestjs"].includes(f)
|
|
214
|
-
);
|
|
215
|
-
if (!hasAppFramework)
|
|
216
|
-
return "library";
|
|
217
|
-
}
|
|
218
|
-
const frontendFrameworks = ["react", "vue", "angular", "svelte"];
|
|
219
|
-
const backendFrameworks = ["express", "fastify", "nestjs", "koa", "hono", "django", "flask", "fastapi", "rails", "laravel"];
|
|
220
|
-
const metaFrameworks = ["nextjs", "nuxt", "remix", "astro"];
|
|
221
|
-
const hasFrontend = frameworks.some((f) => frontendFrameworks.includes(f));
|
|
222
|
-
const hasBackend = frameworks.some((f) => backendFrameworks.includes(f));
|
|
223
|
-
const hasMeta = frameworks.some((f) => metaFrameworks.includes(f));
|
|
224
|
-
if (hasMeta)
|
|
225
|
-
return "fullstack";
|
|
226
|
-
if (hasFrontend && hasBackend)
|
|
227
|
-
return "fullstack";
|
|
228
|
-
if (hasFrontend)
|
|
229
|
-
return "frontend";
|
|
230
|
-
if (hasBackend)
|
|
231
|
-
return "backend";
|
|
232
|
-
return "unknown";
|
|
233
|
-
}
|
|
234
|
-
function detectProject(dir = process__default.cwd()) {
|
|
235
|
-
const pkg = readPackageJson(dir);
|
|
236
|
-
const frameworks = detectFrameworks(dir);
|
|
237
|
-
const languages = detectLanguages(dir);
|
|
238
|
-
const info = {
|
|
239
|
-
name: pkg?.name || "unknown",
|
|
240
|
-
type: "unknown",
|
|
241
|
-
packageManager: detectPackageManager(dir),
|
|
242
|
-
frameworks,
|
|
243
|
-
buildTools: detectBuildTools(dir),
|
|
244
|
-
testFrameworks: detectTestFrameworks(dir),
|
|
245
|
-
cicd: detectCICDSystems(dir),
|
|
246
|
-
languages,
|
|
247
|
-
hasTypeScript: existsSync(join(dir, "tsconfig.json")),
|
|
248
|
-
hasDocker: existsSync(join(dir, "Dockerfile")) || existsSync(join(dir, "docker-compose.yml")),
|
|
249
|
-
hasMonorepo: existsSync(join(dir, "pnpm-workspace.yaml")) || existsSync(join(dir, "lerna.json")) || pkg?.workspaces != null,
|
|
250
|
-
rootDir: dir
|
|
251
|
-
};
|
|
252
|
-
info.type = determineProjectType(info);
|
|
253
|
-
return info;
|
|
254
|
-
}
|
|
255
|
-
function generateSuggestions(project) {
|
|
256
|
-
const suggestions = {
|
|
257
|
-
workflows: ["git"],
|
|
258
|
-
mcpServices: [],
|
|
259
|
-
agents: [],
|
|
260
|
-
skills: [],
|
|
261
|
-
subagentGroups: [],
|
|
262
|
-
outputStyle: "technical-precise"
|
|
263
|
-
};
|
|
264
|
-
if (project.hasTypeScript || project.languages.includes("typescript")) {
|
|
265
|
-
suggestions.subagentGroups.push("typescript-dev");
|
|
266
|
-
suggestions.skills.push("ts-debug", "ts-refactor", "ts-test");
|
|
267
|
-
}
|
|
268
|
-
if (project.languages.includes("python")) {
|
|
269
|
-
suggestions.subagentGroups.push("python-dev");
|
|
270
|
-
suggestions.skills.push("py-debug", "py-refactor", "py-test");
|
|
271
|
-
}
|
|
272
|
-
if (project.frameworks.includes("nextjs") || project.frameworks.includes("nuxt")) {
|
|
273
|
-
suggestions.workflows.push("frontend", "testing");
|
|
274
|
-
suggestions.agents.push("ccjk-performance-expert");
|
|
275
|
-
}
|
|
276
|
-
if (project.frameworks.includes("express") || project.frameworks.includes("fastify") || project.frameworks.includes("nestjs")) {
|
|
277
|
-
suggestions.workflows.push("backend", "testing");
|
|
278
|
-
suggestions.agents.push("ccjk-security-expert");
|
|
279
|
-
}
|
|
280
|
-
if (project.hasDocker || project.cicd.length > 0) {
|
|
281
|
-
suggestions.workflows.push("devops");
|
|
282
|
-
suggestions.subagentGroups.push("devops-team");
|
|
283
|
-
suggestions.skills.push("devops-docker", "devops-ci");
|
|
284
|
-
}
|
|
285
|
-
if (project.testFrameworks.length > 0) {
|
|
286
|
-
suggestions.workflows.push("testing");
|
|
287
|
-
suggestions.agents.push("ccjk-testing-specialist");
|
|
288
|
-
}
|
|
289
|
-
if (project.hasMonorepo) {
|
|
290
|
-
suggestions.agents.push("ccjk-code-reviewer");
|
|
291
|
-
}
|
|
292
|
-
if (project.type === "frontend" || project.type === "fullstack") {
|
|
293
|
-
suggestions.subagentGroups.push("seo-team");
|
|
294
|
-
suggestions.skills.push("seo-meta", "seo-schema");
|
|
295
|
-
}
|
|
296
|
-
suggestions.subagentGroups.push("security-team");
|
|
297
|
-
suggestions.workflows = [...new Set(suggestions.workflows)];
|
|
298
|
-
suggestions.agents = [...new Set(suggestions.agents)];
|
|
299
|
-
suggestions.skills = [...new Set(suggestions.skills)];
|
|
300
|
-
suggestions.subagentGroups = [...new Set(suggestions.subagentGroups)];
|
|
301
|
-
return suggestions;
|
|
302
|
-
}
|
|
303
|
-
function getProjectSummary(project) {
|
|
304
|
-
const parts = [];
|
|
305
|
-
parts.push(`Project: ${project.name}`);
|
|
306
|
-
parts.push(`Type: ${project.type}`);
|
|
307
|
-
if (project.languages.length > 0) {
|
|
308
|
-
parts.push(`Languages: ${project.languages.join(", ")}`);
|
|
309
|
-
}
|
|
310
|
-
if (project.frameworks.length > 0) {
|
|
311
|
-
parts.push(`Frameworks: ${project.frameworks.join(", ")}`);
|
|
312
|
-
}
|
|
313
|
-
if (project.buildTools.length > 0) {
|
|
314
|
-
parts.push(`Build: ${project.buildTools.join(", ")}`);
|
|
315
|
-
}
|
|
316
|
-
if (project.testFrameworks.length > 0) {
|
|
317
|
-
parts.push(`Testing: ${project.testFrameworks.join(", ")}`);
|
|
318
|
-
}
|
|
319
|
-
parts.push(`Package Manager: ${project.packageManager}`);
|
|
320
|
-
const features = [];
|
|
321
|
-
if (project.hasTypeScript)
|
|
322
|
-
features.push("TypeScript");
|
|
323
|
-
if (project.hasDocker)
|
|
324
|
-
features.push("Docker");
|
|
325
|
-
if (project.hasMonorepo)
|
|
326
|
-
features.push("Monorepo");
|
|
327
|
-
if (features.length > 0) {
|
|
328
|
-
parts.push(`Features: ${features.join(", ")}`);
|
|
329
|
-
}
|
|
330
|
-
return parts.join("\n");
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
export { generateSuggestions as a, detectProject as d, getProjectSummary as g };
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import a from '../chunks/index2.mjs';
|
|
2
|
-
import { i as inquirer } from '../chunks/index3.mjs';
|
|
3
|
-
import { i as getMcpService, j as dynamicMcpRegistry, a as readCodexConfig, k as applyCodexPlatformCommand, w as writeCodexConfig, M as MCP_SERVICE_CONFIGS } from '../chunks/codex.mjs';
|
|
4
|
-
import { SETTINGS_FILE, CLAUDE_DIR, ClAUDE_CONFIG_FILE, CODEX_CONFIG_FILE } from '../chunks/constants.mjs';
|
|
5
|
-
import { exists, ensureDir } from '../chunks/fs-operations.mjs';
|
|
6
|
-
import { readJsonConfig, writeJsonConfig } from '../chunks/json-config.mjs';
|
|
7
|
-
import { d as deepMerge, r as readMcpConfig, a as buildMcpServerConfig, w as writeMcpConfig } from '../chunks/claude-config.mjs';
|
|
8
|
-
import { ensureI18nInitialized, i18n } from '../chunks/index5.mjs';
|
|
9
|
-
import { i as isWindows, l as getSystemRoot } from '../chunks/platform.mjs';
|
|
10
|
-
|
|
11
|
-
function readClaudeConfig(configPath = SETTINGS_FILE) {
|
|
12
|
-
try {
|
|
13
|
-
if (!exists(configPath)) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return readJsonConfig(configPath) || null;
|
|
17
|
-
} catch (error) {
|
|
18
|
-
console.error(`Failed to read Claude config from ${configPath}:`, error);
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function writeClaudeConfig(config, options = {}, configPath = SETTINGS_FILE) {
|
|
23
|
-
try {
|
|
24
|
-
ensureDir(CLAUDE_DIR);
|
|
25
|
-
writeJsonConfig(configPath, config, {
|
|
26
|
-
atomic: options.atomic !== false,
|
|
27
|
-
pretty: true,
|
|
28
|
-
backup: options.backup
|
|
29
|
-
});
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.error(`Failed to write Claude config to ${configPath}:`, error);
|
|
32
|
-
throw new Error(`Failed to write Claude config: ${error instanceof Error ? error.message : String(error)}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function updateClaudeConfig(updates, options = {}, configPath = SETTINGS_FILE) {
|
|
36
|
-
const existingConfig = readClaudeConfig(configPath) || {};
|
|
37
|
-
const mergedConfig = deepMerge(existingConfig, updates, {
|
|
38
|
-
mergeArrays: options.merge === "preserve",
|
|
39
|
-
arrayMergeStrategy: "unique"
|
|
40
|
-
});
|
|
41
|
-
writeClaudeConfig(mergedConfig, options, configPath);
|
|
42
|
-
return mergedConfig;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const claudeConfig = {
|
|
46
|
-
__proto__: null,
|
|
47
|
-
readClaudeConfig: readClaudeConfig,
|
|
48
|
-
updateClaudeConfig: updateClaudeConfig,
|
|
49
|
-
writeClaudeConfig: writeClaudeConfig
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function detectActiveTool() {
|
|
53
|
-
const hasClaudeConfig = exists(ClAUDE_CONFIG_FILE);
|
|
54
|
-
const hasCodexConfig = exists(CODEX_CONFIG_FILE);
|
|
55
|
-
if (hasClaudeConfig) {
|
|
56
|
-
return "claude-code";
|
|
57
|
-
}
|
|
58
|
-
if (hasCodexConfig) {
|
|
59
|
-
return "codex";
|
|
60
|
-
}
|
|
61
|
-
return "claude-code";
|
|
62
|
-
}
|
|
63
|
-
async function installMcpService(serviceId, tool, apiKey) {
|
|
64
|
-
ensureI18nInitialized();
|
|
65
|
-
const service = await getMcpService(serviceId);
|
|
66
|
-
if (!service) {
|
|
67
|
-
return {
|
|
68
|
-
success: false,
|
|
69
|
-
serviceId,
|
|
70
|
-
serviceName: serviceId,
|
|
71
|
-
error: i18n.t("mcp:installer.serviceNotFound", { id: serviceId })
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
if (service.requiresApiKey && !apiKey) {
|
|
75
|
-
const promptMessage = service.apiKeyPrompt || i18n.t("mcp:apiKeyPrompt");
|
|
76
|
-
const { inputApiKey } = await inquirer.prompt([{
|
|
77
|
-
type: "input",
|
|
78
|
-
name: "inputApiKey",
|
|
79
|
-
message: promptMessage,
|
|
80
|
-
validate: (input) => !!input || i18n.t("api:keyRequired")
|
|
81
|
-
}]);
|
|
82
|
-
if (!inputApiKey) {
|
|
83
|
-
return {
|
|
84
|
-
success: false,
|
|
85
|
-
serviceId,
|
|
86
|
-
serviceName: service.name,
|
|
87
|
-
error: i18n.t("mcp:installer.apiKeyRequired")
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
apiKey = inputApiKey;
|
|
91
|
-
}
|
|
92
|
-
const targetTool = tool || detectActiveTool();
|
|
93
|
-
try {
|
|
94
|
-
if (targetTool === "codex") {
|
|
95
|
-
await installMcpServiceForCodex(serviceId, service.config, apiKey, service.apiKeyEnvVar);
|
|
96
|
-
} else {
|
|
97
|
-
await installMcpServiceForClaudeCode(serviceId, service.config, apiKey, service.apiKeyEnvVar);
|
|
98
|
-
}
|
|
99
|
-
dynamicMcpRegistry.addService(serviceId, service.config);
|
|
100
|
-
return {
|
|
101
|
-
success: true,
|
|
102
|
-
serviceId,
|
|
103
|
-
serviceName: service.name
|
|
104
|
-
};
|
|
105
|
-
} catch (error) {
|
|
106
|
-
return {
|
|
107
|
-
success: false,
|
|
108
|
-
serviceId,
|
|
109
|
-
serviceName: service.name,
|
|
110
|
-
error: error instanceof Error ? error.message : String(error)
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function installMcpServiceForClaudeCode(serviceId, baseConfig, apiKey, apiKeyEnvVar) {
|
|
115
|
-
let config = readMcpConfig();
|
|
116
|
-
if (!config) {
|
|
117
|
-
config = { mcpServers: {} };
|
|
118
|
-
}
|
|
119
|
-
const serverConfig = buildMcpServerConfig(
|
|
120
|
-
baseConfig,
|
|
121
|
-
apiKey,
|
|
122
|
-
apiKeyEnvVar ? `YOUR_${apiKeyEnvVar}` : "YOUR_API_KEY",
|
|
123
|
-
apiKeyEnvVar
|
|
124
|
-
);
|
|
125
|
-
if (!config.mcpServers) {
|
|
126
|
-
config.mcpServers = {};
|
|
127
|
-
}
|
|
128
|
-
config.mcpServers[serviceId] = serverConfig;
|
|
129
|
-
writeMcpConfig(config);
|
|
130
|
-
await autoAuthorizeMcpService(serviceId);
|
|
131
|
-
}
|
|
132
|
-
async function installMcpServiceForCodex(serviceId, baseConfig, apiKey, apiKeyEnvVar) {
|
|
133
|
-
const existingConfig = readCodexConfig();
|
|
134
|
-
let command = baseConfig.command || serviceId;
|
|
135
|
-
let args = (baseConfig.args || []).map((arg) => String(arg));
|
|
136
|
-
if (serviceId === "serena") {
|
|
137
|
-
const idx = args.indexOf("--context");
|
|
138
|
-
if (idx >= 0 && idx + 1 < args.length) {
|
|
139
|
-
args[idx + 1] = "codex";
|
|
140
|
-
} else {
|
|
141
|
-
args.push("--context", "codex");
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const serviceConfig = { id: serviceId.toLowerCase(), command, args };
|
|
145
|
-
applyCodexPlatformCommand(serviceConfig);
|
|
146
|
-
command = serviceConfig.command;
|
|
147
|
-
args = serviceConfig.args || [];
|
|
148
|
-
const env = { ...baseConfig.env || {} };
|
|
149
|
-
if (isWindows()) {
|
|
150
|
-
const systemRoot = getSystemRoot();
|
|
151
|
-
if (systemRoot) {
|
|
152
|
-
env.SYSTEMROOT = systemRoot;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (apiKey && apiKeyEnvVar) {
|
|
156
|
-
env[apiKeyEnvVar] = apiKey;
|
|
157
|
-
}
|
|
158
|
-
const newService = {
|
|
159
|
-
id: serviceId.toLowerCase(),
|
|
160
|
-
command,
|
|
161
|
-
args,
|
|
162
|
-
env: Object.keys(env).length > 0 ? env : void 0,
|
|
163
|
-
startup_timeout_sec: 30
|
|
164
|
-
};
|
|
165
|
-
const existingServices = existingConfig?.mcpServices || [];
|
|
166
|
-
const mergedMap = /* @__PURE__ */ new Map();
|
|
167
|
-
for (const svc of existingServices) {
|
|
168
|
-
mergedMap.set(svc.id.toLowerCase(), { ...svc });
|
|
169
|
-
}
|
|
170
|
-
mergedMap.set(newService.id, newService);
|
|
171
|
-
const finalServices = Array.from(mergedMap.values());
|
|
172
|
-
const configData = {
|
|
173
|
-
model: existingConfig?.model || null,
|
|
174
|
-
modelProvider: existingConfig?.modelProvider || null,
|
|
175
|
-
providers: existingConfig?.providers || [],
|
|
176
|
-
mcpServices: finalServices,
|
|
177
|
-
otherConfig: existingConfig?.otherConfig || []
|
|
178
|
-
};
|
|
179
|
-
writeCodexConfig(configData);
|
|
180
|
-
}
|
|
181
|
-
async function uninstallMcpService(serviceId, tool) {
|
|
182
|
-
ensureI18nInitialized();
|
|
183
|
-
const targetTool = tool || detectActiveTool();
|
|
184
|
-
try {
|
|
185
|
-
if (targetTool === "codex") {
|
|
186
|
-
await uninstallMcpServiceFromCodex(serviceId);
|
|
187
|
-
} else {
|
|
188
|
-
await uninstallMcpServiceFromClaudeCode(serviceId);
|
|
189
|
-
}
|
|
190
|
-
dynamicMcpRegistry.removeService(serviceId);
|
|
191
|
-
return {
|
|
192
|
-
success: true,
|
|
193
|
-
serviceId
|
|
194
|
-
};
|
|
195
|
-
} catch (error) {
|
|
196
|
-
return {
|
|
197
|
-
success: false,
|
|
198
|
-
serviceId,
|
|
199
|
-
error: error instanceof Error ? error.message : String(error)
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
async function uninstallMcpServiceFromClaudeCode(serviceId) {
|
|
204
|
-
const config = readMcpConfig();
|
|
205
|
-
if (!config || !config.mcpServers) {
|
|
206
|
-
throw new Error(i18n.t("mcp:installer.noConfig"));
|
|
207
|
-
}
|
|
208
|
-
const normalizedId = serviceId.toLowerCase();
|
|
209
|
-
const existingKey = Object.keys(config.mcpServers).find(
|
|
210
|
-
(key) => key.toLowerCase() === normalizedId
|
|
211
|
-
);
|
|
212
|
-
if (!existingKey) {
|
|
213
|
-
throw new Error(i18n.t("mcp:installer.serviceNotInstalled", { id: serviceId }));
|
|
214
|
-
}
|
|
215
|
-
delete config.mcpServers[existingKey];
|
|
216
|
-
writeMcpConfig(config);
|
|
217
|
-
await removeAuthorizeMcpService(serviceId);
|
|
218
|
-
}
|
|
219
|
-
async function uninstallMcpServiceFromCodex(serviceId) {
|
|
220
|
-
const existingConfig = readCodexConfig();
|
|
221
|
-
if (!existingConfig || !existingConfig.mcpServices) {
|
|
222
|
-
throw new Error(i18n.t("mcp:installer.noConfig"));
|
|
223
|
-
}
|
|
224
|
-
const normalizedId = serviceId.toLowerCase();
|
|
225
|
-
const serviceIndex = existingConfig.mcpServices.findIndex(
|
|
226
|
-
(svc) => svc.id.toLowerCase() === normalizedId
|
|
227
|
-
);
|
|
228
|
-
if (serviceIndex === -1) {
|
|
229
|
-
throw new Error(i18n.t("mcp:installer.serviceNotInstalled", { id: serviceId }));
|
|
230
|
-
}
|
|
231
|
-
existingConfig.mcpServices.splice(serviceIndex, 1);
|
|
232
|
-
writeCodexConfig(existingConfig);
|
|
233
|
-
}
|
|
234
|
-
async function listInstalledMcpServices(tool) {
|
|
235
|
-
ensureI18nInitialized();
|
|
236
|
-
const targetTool = tool || detectActiveTool();
|
|
237
|
-
if (targetTool === "codex") {
|
|
238
|
-
return listInstalledMcpServicesFromCodex();
|
|
239
|
-
} else {
|
|
240
|
-
return listInstalledMcpServicesFromClaudeCode();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function listInstalledMcpServicesFromClaudeCode() {
|
|
244
|
-
const config = readMcpConfig();
|
|
245
|
-
if (!config || !config.mcpServers) {
|
|
246
|
-
return [];
|
|
247
|
-
}
|
|
248
|
-
const services = [];
|
|
249
|
-
for (const [id, serverConfig] of Object.entries(config.mcpServers)) {
|
|
250
|
-
const knownService = MCP_SERVICE_CONFIGS.find(
|
|
251
|
-
(s) => s.id.toLowerCase() === id.toLowerCase()
|
|
252
|
-
);
|
|
253
|
-
services.push({
|
|
254
|
-
id,
|
|
255
|
-
name: knownService?.id || id,
|
|
256
|
-
command: serverConfig.command,
|
|
257
|
-
args: serverConfig.args,
|
|
258
|
-
url: serverConfig.url,
|
|
259
|
-
type: serverConfig.type || "stdio"
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
return services;
|
|
263
|
-
}
|
|
264
|
-
function listInstalledMcpServicesFromCodex() {
|
|
265
|
-
const config = readCodexConfig();
|
|
266
|
-
if (!config || !config.mcpServices) {
|
|
267
|
-
return [];
|
|
268
|
-
}
|
|
269
|
-
const services = [];
|
|
270
|
-
for (const svc of config.mcpServices) {
|
|
271
|
-
const knownService = MCP_SERVICE_CONFIGS.find(
|
|
272
|
-
(s) => s.id.toLowerCase() === svc.id.toLowerCase()
|
|
273
|
-
);
|
|
274
|
-
services.push({
|
|
275
|
-
id: svc.id,
|
|
276
|
-
name: knownService?.id || svc.id,
|
|
277
|
-
command: svc.command,
|
|
278
|
-
args: svc.args,
|
|
279
|
-
type: "stdio"
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
return services;
|
|
283
|
-
}
|
|
284
|
-
async function isMcpServiceInstalled(serviceId, tool) {
|
|
285
|
-
const installedServices = await listInstalledMcpServices(tool);
|
|
286
|
-
const normalizedId = serviceId.toLowerCase();
|
|
287
|
-
return installedServices.some((svc) => svc.id.toLowerCase() === normalizedId);
|
|
288
|
-
}
|
|
289
|
-
async function installMcpServices(serviceIds, tool) {
|
|
290
|
-
const results = [];
|
|
291
|
-
for (const serviceId of serviceIds) {
|
|
292
|
-
const result = await installMcpService(serviceId, tool);
|
|
293
|
-
results.push(result);
|
|
294
|
-
}
|
|
295
|
-
return results;
|
|
296
|
-
}
|
|
297
|
-
async function displayInstalledMcpServices(tool) {
|
|
298
|
-
ensureI18nInitialized();
|
|
299
|
-
const targetTool = tool || detectActiveTool();
|
|
300
|
-
const services = await listInstalledMcpServices(targetTool);
|
|
301
|
-
if (services.length === 0) {
|
|
302
|
-
console.log(a.yellow(i18n.t("mcp:installer.noServicesInstalled")));
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
console.log(a.green.bold(`
|
|
306
|
-
${i18n.t("mcp:installer.installedServices", { tool: targetTool })}
|
|
307
|
-
`));
|
|
308
|
-
services.forEach((service, idx) => {
|
|
309
|
-
console.log(`${a.green(`${idx + 1}.`)} ${a.bold(service.name)} ${a.dim(`[${service.id}]`)}`);
|
|
310
|
-
if (service.command) {
|
|
311
|
-
console.log(` ${a.dim(`Command: ${service.command}`)}`);
|
|
312
|
-
}
|
|
313
|
-
if (service.url) {
|
|
314
|
-
console.log(` ${a.dim(`URL: ${service.url}`)}`);
|
|
315
|
-
}
|
|
316
|
-
console.log("");
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
async function autoAuthorizeMcpService(serviceId) {
|
|
320
|
-
const mcpPermission = `mcp__${serviceId.toLowerCase().replace(/-/g, "_")}`;
|
|
321
|
-
const { readClaudeConfig } = await Promise.resolve().then(function () { return claudeConfig; });
|
|
322
|
-
const currentSettings = readClaudeConfig() || {};
|
|
323
|
-
if (!currentSettings.permissions) {
|
|
324
|
-
currentSettings.permissions = {};
|
|
325
|
-
}
|
|
326
|
-
if (!currentSettings.permissions.allow) {
|
|
327
|
-
currentSettings.permissions.allow = [];
|
|
328
|
-
}
|
|
329
|
-
if (!currentSettings.permissions.allow.includes(mcpPermission)) {
|
|
330
|
-
currentSettings.permissions.allow.push(mcpPermission);
|
|
331
|
-
updateClaudeConfig({
|
|
332
|
-
permissions: currentSettings.permissions
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
async function removeAuthorizeMcpService(serviceId) {
|
|
337
|
-
const mcpPermission = `mcp__${serviceId.toLowerCase().replace(/-/g, "_")}`;
|
|
338
|
-
const { readClaudeConfig } = await Promise.resolve().then(function () { return claudeConfig; });
|
|
339
|
-
const currentSettings = readClaudeConfig() || {};
|
|
340
|
-
if (currentSettings.permissions?.allow) {
|
|
341
|
-
const index = currentSettings.permissions.allow.indexOf(mcpPermission);
|
|
342
|
-
if (index !== -1) {
|
|
343
|
-
currentSettings.permissions.allow.splice(index, 1);
|
|
344
|
-
updateClaudeConfig({
|
|
345
|
-
permissions: currentSettings.permissions
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export { installMcpServices as a, isMcpServiceInstalled as b, displayInstalledMcpServices as d, installMcpService as i, uninstallMcpService as u };
|