ccjk 2.2.2 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/chunks/auto-updater.mjs +37 -3
  2. package/dist/chunks/ccjk-config.mjs +77 -13
  3. package/dist/chunks/ccr.mjs +8 -11
  4. package/dist/chunks/ccu.mjs +4 -4
  5. package/dist/chunks/check-updates.mjs +5 -8
  6. package/dist/chunks/claude-code-config-manager.mjs +8 -11
  7. package/dist/chunks/claude-code-incremental-manager.mjs +4 -7
  8. package/dist/chunks/codex.mjs +496 -17
  9. package/dist/chunks/commands.mjs +392 -89
  10. package/dist/chunks/commands2.mjs +109 -0
  11. package/dist/chunks/config-consolidator.mjs +2 -2
  12. package/dist/chunks/config-switch.mjs +5 -8
  13. package/dist/chunks/doctor.mjs +6 -6
  14. package/dist/chunks/features.mjs +654 -35
  15. package/dist/chunks/help.mjs +339 -0
  16. package/dist/chunks/index.mjs +323 -10
  17. package/dist/chunks/index2.mjs +3 -3
  18. package/dist/chunks/index3.mjs +1171 -0
  19. package/dist/chunks/init.mjs +22 -25
  20. package/dist/chunks/installer.mjs +178 -0
  21. package/dist/chunks/interview.mjs +6 -6
  22. package/dist/chunks/mcp-performance.mjs +82 -2
  23. package/dist/chunks/mcp.mjs +500 -0
  24. package/dist/chunks/menu.mjs +10 -10
  25. package/dist/chunks/notification.mjs +5 -5
  26. package/dist/chunks/onboarding.mjs +6 -6
  27. package/dist/chunks/package.mjs +1 -1
  28. package/dist/chunks/platform.mjs +10 -10
  29. package/dist/chunks/prompts.mjs +7 -8
  30. package/dist/chunks/session.mjs +2 -2
  31. package/dist/chunks/skills-sync.mjs +2 -2
  32. package/dist/chunks/uninstall.mjs +4 -5
  33. package/dist/chunks/update.mjs +5 -8
  34. package/dist/chunks/upgrade-manager.mjs +2 -2
  35. package/dist/{shared/ccjk.Cy-RH2qV.mjs → chunks/version-checker.mjs} +373 -30
  36. package/dist/cli.mjs +293 -53
  37. package/dist/i18n/locales/en/agentBrowser.json +79 -0
  38. package/dist/i18n/locales/en/mcp.json +2 -4
  39. package/dist/i18n/locales/en/updater.json +5 -2
  40. package/dist/i18n/locales/zh/agentBrowser.json +79 -0
  41. package/dist/i18n/locales/zh-CN/common.json +1 -1
  42. package/dist/i18n/locales/zh-CN/mcp.json +2 -4
  43. package/dist/i18n/locales/zh-CN/updater.json +5 -2
  44. package/dist/index.d.mts +8 -584
  45. package/dist/index.d.ts +8 -584
  46. package/dist/index.mjs +10 -14
  47. package/dist/shared/{ccjk.DJM5aVQJ.mjs → ccjk.ByTIGCUC.mjs} +3 -3
  48. package/dist/shared/{ccjk.qYAnUMuy.mjs → ccjk.CGTmRqsu.mjs} +2 -3
  49. package/dist/shared/{ccjk.CUdzQluX.mjs → ccjk.CURU8gbR.mjs} +1 -1
  50. package/dist/{chunks/mcp-market.mjs → shared/ccjk.D-RZS4E2.mjs} +6 -65
  51. package/dist/shared/{ccjk.B7169qud.mjs → ccjk.tB4-Y4Qb.mjs} +3 -3
  52. package/package.json +4 -1
  53. package/templates/common/skills/en/agent-browser.md +258 -0
  54. package/templates/common/skills/zh-CN/agent-browser.md +260 -0
  55. package/dist/chunks/claude-config.mjs +0 -228
  56. package/dist/chunks/features2.mjs +0 -661
  57. package/dist/chunks/json-config.mjs +0 -59
  58. package/dist/chunks/mcp-doctor.mjs +0 -160
  59. package/dist/chunks/mcp-profile.mjs +0 -220
  60. package/dist/chunks/mcp-release.mjs +0 -138
  61. package/dist/chunks/shencha.mjs +0 -320
  62. package/dist/chunks/tools.mjs +0 -169
  63. package/dist/shared/ccjk.COdsoe-Y.mjs +0 -64
  64. package/dist/shared/ccjk.DwDtZ5cK.mjs +0 -266
  65. package/dist/shared/ccjk.n_AtlHzB.mjs +0 -186
@@ -0,0 +1,500 @@
1
+ import ansis from 'ansis';
2
+ import { i18n } from './index2.mjs';
3
+ import 'node:child_process';
4
+ import 'node:process';
5
+ import { M as MCP_SERVICE_TIERS, i as isCoreService, g as getServicesByTier, c as checkMcpPerformance, f as formatPerformanceWarning, a as calculateResourceUsage, b as getOptimizationSuggestions, d as getMcpTierConfig } from './mcp-performance.mjs';
6
+ import { e as readMcpConfig, h as backupMcpConfig, f as writeMcpConfig, ab as MCP_SERVICE_CONFIGS } from './codex.mjs';
7
+ export { m as mcpInstall, a as mcpList, b as mcpSearch, c as mcpUninstall } from '../shared/ccjk.D-RZS4E2.mjs';
8
+ import 'node:fs';
9
+ import 'node:url';
10
+ import 'i18next';
11
+ import 'i18next-fs-backend';
12
+ import 'pathe';
13
+ import 'dayjs';
14
+ import 'inquirer';
15
+ import 'ora';
16
+ import 'semver';
17
+ import 'smol-toml';
18
+ import 'tinyexec';
19
+ import './constants.mjs';
20
+ import 'node:os';
21
+ import './ccjk-config.mjs';
22
+ import './fs-operations.mjs';
23
+ import 'node:crypto';
24
+ import 'node:fs/promises';
25
+ import './platform.mjs';
26
+ import '../shared/ccjk.DhBeLRzf.mjs';
27
+ import 'inquirer-toggle';
28
+ import './prompts.mjs';
29
+ import './package.mjs';
30
+
31
+ function getReleasableServices(configuredServices, tier) {
32
+ return configuredServices.filter((serviceId) => {
33
+ if (isCoreService(serviceId)) {
34
+ return false;
35
+ }
36
+ const serviceTier = MCP_SERVICE_TIERS[serviceId] || "ondemand";
37
+ if (tier === "all") {
38
+ return true;
39
+ }
40
+ if (tier) {
41
+ return serviceTier === tier;
42
+ }
43
+ return serviceTier === "ondemand" || serviceTier === "scenario";
44
+ });
45
+ }
46
+ async function releaseServices(servicesToRelease, options = {}) {
47
+ const result = {
48
+ success: true,
49
+ releasedServices: [],
50
+ skippedServices: [],
51
+ errors: []
52
+ };
53
+ if (servicesToRelease.length === 0) {
54
+ return result;
55
+ }
56
+ const config = readMcpConfig();
57
+ if (!config?.mcpServers) {
58
+ result.errors.push("No MCP configuration found");
59
+ result.success = false;
60
+ return result;
61
+ }
62
+ if (!options.dryRun) {
63
+ backupMcpConfig();
64
+ }
65
+ const newServers = { ...config.mcpServers };
66
+ for (const serviceId of servicesToRelease) {
67
+ if (isCoreService(serviceId) && !options.force) {
68
+ result.skippedServices.push(serviceId);
69
+ continue;
70
+ }
71
+ if (!newServers[serviceId]) {
72
+ result.skippedServices.push(serviceId);
73
+ continue;
74
+ }
75
+ if (!options.dryRun) {
76
+ delete newServers[serviceId];
77
+ }
78
+ result.releasedServices.push(serviceId);
79
+ }
80
+ if (!options.dryRun && result.releasedServices.length > 0) {
81
+ try {
82
+ writeMcpConfig({ ...config, mcpServers: newServers });
83
+ } catch (error) {
84
+ result.errors.push(`Failed to write config: ${error}`);
85
+ result.success = false;
86
+ }
87
+ }
88
+ return result;
89
+ }
90
+ async function mcpRelease(options = {}) {
91
+ const lang = options.lang || i18n.language || "en";
92
+ const isZh = lang === "zh-CN";
93
+ console.log("");
94
+ console.log(ansis.bold.cyan(isZh ? "\u{1F9F9} MCP \u670D\u52A1\u91CA\u653E" : "\u{1F9F9} MCP Service Release"));
95
+ console.log(ansis.dim("\u2500".repeat(50)));
96
+ console.log("");
97
+ const config = readMcpConfig();
98
+ const configuredServices = config?.mcpServers ? Object.keys(config.mcpServers) : [];
99
+ if (configuredServices.length === 0) {
100
+ console.log(ansis.yellow(isZh ? "\u6CA1\u6709\u914D\u7F6E\u4EFB\u4F55 MCP \u670D\u52A1" : "No MCP services configured"));
101
+ return;
102
+ }
103
+ let servicesToRelease;
104
+ if (options.service) {
105
+ servicesToRelease = [options.service];
106
+ } else if (options.tier) {
107
+ servicesToRelease = getReleasableServices(configuredServices, options.tier);
108
+ } else {
109
+ servicesToRelease = getReleasableServices(configuredServices, "all");
110
+ }
111
+ if (servicesToRelease.length === 0) {
112
+ console.log(ansis.green(isZh ? "\u2714 \u6CA1\u6709\u53EF\u91CA\u653E\u7684\u670D\u52A1" : "\u2714 No services to release"));
113
+ return;
114
+ }
115
+ console.log(isZh ? "\u5C06\u91CA\u653E\u4EE5\u4E0B\u670D\u52A1:" : "Services to release:");
116
+ for (const serviceId of servicesToRelease) {
117
+ const tier = MCP_SERVICE_TIERS[serviceId] || "ondemand";
118
+ console.log(` ${ansis.yellow("\u2022")} ${serviceId} ${ansis.dim(`[${tier}]`)}`);
119
+ }
120
+ console.log("");
121
+ if (options.dryRun) {
122
+ console.log(ansis.blue(isZh ? "(\u6A21\u62DF\u8FD0\u884C - \u4E0D\u4F1A\u5B9E\u9645\u4FEE\u6539\u914D\u7F6E)" : "(Dry run - no changes will be made)"));
123
+ return;
124
+ }
125
+ const result = await releaseServices(servicesToRelease, options);
126
+ if (result.success) {
127
+ console.log(ansis.green(`\u2714 ${isZh ? "\u5DF2\u91CA\u653E" : "Released"} ${result.releasedServices.length} ${isZh ? "\u4E2A\u670D\u52A1" : "services"}`));
128
+ if (result.skippedServices.length > 0) {
129
+ console.log(ansis.yellow(`${isZh ? "\u8DF3\u8FC7" : "Skipped"}: ${result.skippedServices.join(", ")}`));
130
+ }
131
+ const remaining = configuredServices.filter((s) => !result.releasedServices.includes(s));
132
+ console.log("");
133
+ console.log(ansis.dim(`${isZh ? "\u5269\u4F59\u670D\u52A1" : "Remaining services"}: ${remaining.length}`));
134
+ if (remaining.length > 0) {
135
+ console.log(ansis.dim(` ${remaining.join(", ")}`));
136
+ }
137
+ console.log("");
138
+ console.log(ansis.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u91CD\u542F Claude Code \u4EE5\u4F7F\u66F4\u6539\u751F\u6548" : "\u26A0\uFE0F Please restart Claude Code for changes to take effect"));
139
+ } else {
140
+ console.log(ansis.red(`\u2716 ${isZh ? "\u91CA\u653E\u5931\u8D25" : "Release failed"}`));
141
+ for (const error of result.errors) {
142
+ console.log(ansis.red(` ${error}`));
143
+ }
144
+ }
145
+ }
146
+
147
+ function checkServiceHealth(serviceId, configuredServices) {
148
+ const tierConfig = getMcpTierConfig(serviceId);
149
+ const tier = MCP_SERVICE_TIERS[serviceId] || "ondemand";
150
+ const isConfigured = configuredServices.includes(serviceId);
151
+ const issues = [];
152
+ const suggestions = [];
153
+ let status = "healthy";
154
+ if (isConfigured && !MCP_SERVICE_TIERS[serviceId]) {
155
+ issues.push("Service not in tier system (using default: ondemand)");
156
+ status = "warning";
157
+ }
158
+ if (serviceId === "Playwright" && configuredServices.includes("puppeteer")) {
159
+ issues.push("Both Playwright and Puppeteer are enabled");
160
+ suggestions.push("Consider using only one browser automation service");
161
+ status = "warning";
162
+ }
163
+ if (serviceId === "puppeteer" && configuredServices.includes("Playwright")) {
164
+ issues.push("Both Puppeteer and Playwright are enabled");
165
+ suggestions.push("Consider using only one browser automation service");
166
+ status = "warning";
167
+ }
168
+ if (tier === "scenario" && isConfigured) {
169
+ suggestions.push("Scenario service - consider disabling when not needed");
170
+ }
171
+ return {
172
+ serviceId,
173
+ status,
174
+ tier,
175
+ autoStart: tierConfig.autoStart,
176
+ idleTimeout: tierConfig.idleTimeout,
177
+ issues,
178
+ suggestions
179
+ };
180
+ }
181
+ async function mcpDoctor(options = {}) {
182
+ const lang = options.lang || i18n.language || "en";
183
+ const isZh = lang === "zh-CN";
184
+ console.log("");
185
+ console.log(ansis.bold.cyan(isZh ? "\u{1F50D} MCP \u5065\u5EB7\u68C0\u67E5" : "\u{1F50D} MCP Health Check"));
186
+ console.log(ansis.dim("\u2550".repeat(60)));
187
+ console.log("");
188
+ const config = readMcpConfig();
189
+ const configuredServices = config?.mcpServers ? Object.keys(config.mcpServers) : [];
190
+ console.log(ansis.bold(isZh ? "\u{1F4CA} \u670D\u52A1\u7EDF\u8BA1" : "\u{1F4CA} Service Statistics"));
191
+ console.log(ansis.dim("\u2500".repeat(40)));
192
+ const coreServices = getServicesByTier("core");
193
+ const ondemandServices = getServicesByTier("ondemand");
194
+ const scenarioServices = getServicesByTier("scenario");
195
+ const configuredCore = configuredServices.filter((s) => coreServices.includes(s));
196
+ const configuredOndemand = configuredServices.filter((s) => ondemandServices.includes(s));
197
+ const configuredScenario = configuredServices.filter((s) => scenarioServices.includes(s));
198
+ console.log(` ${isZh ? "\u603B\u8BA1" : "Total"}: ${ansis.bold(configuredServices.length.toString())} ${isZh ? "\u4E2A\u670D\u52A1" : "services"}`);
199
+ console.log(` ${ansis.green("Core")}: ${configuredCore.length}/${coreServices.length}`);
200
+ console.log(` ${ansis.yellow("OnDemand")}: ${configuredOndemand.length}/${ondemandServices.length}`);
201
+ console.log(` ${ansis.blue("Scenario")}: ${configuredScenario.length}/${scenarioServices.length}`);
202
+ console.log("");
203
+ const perfWarning = checkMcpPerformance(configuredServices.length);
204
+ if (perfWarning) {
205
+ console.log(ansis.bold(isZh ? "\u26A0\uFE0F \u6027\u80FD\u8B66\u544A" : "\u26A0\uFE0F Performance Warning"));
206
+ console.log(ansis.dim("\u2500".repeat(40)));
207
+ console.log(formatPerformanceWarning(perfWarning, lang));
208
+ console.log("");
209
+ }
210
+ const resourceUsage = calculateResourceUsage(configuredServices.length);
211
+ console.log(ansis.bold(isZh ? "\u{1F4BB} \u8D44\u6E90\u4F7F\u7528\u4F30\u7B97" : "\u{1F4BB} Resource Usage Estimate"));
212
+ console.log(ansis.dim("\u2500".repeat(40)));
213
+ const ratingColors = {
214
+ low: ansis.green,
215
+ medium: ansis.yellow,
216
+ high: ansis.red,
217
+ critical: ansis.bgRed.white
218
+ };
219
+ const ratingLabels = {
220
+ low: isZh ? "\u4F4E" : "Low",
221
+ medium: isZh ? "\u4E2D" : "Medium",
222
+ high: isZh ? "\u9AD8" : "High",
223
+ critical: isZh ? "\u4E25\u91CD" : "Critical"
224
+ };
225
+ console.log(` ${isZh ? "\u5185\u5B58" : "Memory"}: ~${resourceUsage.memory.value}${resourceUsage.memory.unit}`);
226
+ console.log(` ${isZh ? "CPU" : "CPU"}: ~${resourceUsage.cpu.value}${resourceUsage.cpu.unit}`);
227
+ console.log(` ${isZh ? "\u8BC4\u7EA7" : "Rating"}: ${ratingColors[resourceUsage.rating](ratingLabels[resourceUsage.rating])}`);
228
+ console.log("");
229
+ if (options.verbose || options.service) {
230
+ console.log(ansis.bold(isZh ? "\u{1F527} \u670D\u52A1\u8BE6\u60C5" : "\u{1F527} Service Details"));
231
+ console.log(ansis.dim("\u2500".repeat(40)));
232
+ const servicesToCheck = options.service ? [options.service] : configuredServices;
233
+ for (const serviceId of servicesToCheck) {
234
+ const health = checkServiceHealth(serviceId, configuredServices);
235
+ const statusIcon = {
236
+ healthy: ansis.green("\u2714"),
237
+ warning: ansis.yellow("\u26A0"),
238
+ error: ansis.red("\u2716"),
239
+ unknown: ansis.gray("?")
240
+ };
241
+ const tierColor = {
242
+ core: ansis.green,
243
+ ondemand: ansis.yellow,
244
+ scenario: ansis.blue
245
+ };
246
+ console.log(` ${statusIcon[health.status]} ${ansis.bold(serviceId)}`);
247
+ console.log(` ${isZh ? "\u5C42\u7EA7" : "Tier"}: ${(tierColor[health.tier] || ansis.gray)(health.tier)}`);
248
+ if (health.idleTimeout) {
249
+ console.log(` ${isZh ? "\u7A7A\u95F2\u8D85\u65F6" : "Idle Timeout"}: ${health.idleTimeout}s`);
250
+ }
251
+ if (health.issues.length > 0) {
252
+ for (const issue of health.issues) {
253
+ console.log(` ${ansis.yellow("!")} ${issue}`);
254
+ }
255
+ }
256
+ if (health.suggestions.length > 0) {
257
+ for (const suggestion of health.suggestions) {
258
+ console.log(` ${ansis.dim("\u2192")} ${suggestion}`);
259
+ }
260
+ }
261
+ console.log("");
262
+ }
263
+ }
264
+ const suggestions = getOptimizationSuggestions(configuredServices);
265
+ if (suggestions.length > 0) {
266
+ console.log(ansis.bold(isZh ? "\u{1F4A1} \u4F18\u5316\u5EFA\u8BAE" : "\u{1F4A1} Optimization Suggestions"));
267
+ console.log(ansis.dim("\u2500".repeat(40)));
268
+ for (const suggestion of suggestions) {
269
+ console.log(` \u2022 ${suggestion}`);
270
+ }
271
+ console.log("");
272
+ }
273
+ console.log(ansis.bold(isZh ? "\u{1F680} \u5FEB\u901F\u64CD\u4F5C" : "\u{1F680} Quick Actions"));
274
+ console.log(ansis.dim("\u2500".repeat(40)));
275
+ console.log(` ${ansis.cyan("ccjk mcp profile use minimal")} - ${isZh ? "\u5207\u6362\u5230\u6781\u7B80\u6A21\u5F0F" : "Switch to minimal mode"}`);
276
+ console.log(` ${ansis.cyan("ccjk mcp profile list")} - ${isZh ? "\u67E5\u770B\u6240\u6709\u9884\u8BBE" : "View all profiles"}`);
277
+ console.log(` ${ansis.cyan("ccjk mcp release")} - ${isZh ? "\u91CA\u653E\u7A7A\u95F2\u670D\u52A1" : "Release idle services"}`);
278
+ console.log("");
279
+ console.log(ansis.dim("\u2550".repeat(60)));
280
+ const summaryStatus = perfWarning?.level === "critical" ? ansis.red(isZh ? "\u9700\u8981\u4F18\u5316" : "Needs Optimization") : perfWarning?.level === "warning" ? ansis.yellow(isZh ? "\u5EFA\u8BAE\u4F18\u5316" : "Optimization Recommended") : ansis.green(isZh ? "\u72B6\u6001\u826F\u597D" : "Healthy");
281
+ console.log(`${isZh ? "\u603B\u4F53\u72B6\u6001" : "Overall Status"}: ${summaryStatus}`);
282
+ console.log("");
283
+ }
284
+
285
+ const MCP_PROFILES = [
286
+ {
287
+ id: "minimal",
288
+ name: "Minimal",
289
+ nameZh: "\u6781\u7B80\u6A21\u5F0F",
290
+ description: "Core services only, best performance",
291
+ descriptionZh: "\u4EC5\u6838\u5FC3\u670D\u52A1\uFF0C\u6700\u4F73\u6027\u80FD",
292
+ services: ["context7", "open-websearch"],
293
+ maxServices: 3,
294
+ tier: "core"
295
+ },
296
+ {
297
+ id: "development",
298
+ name: "Development",
299
+ nameZh: "\u5F00\u53D1\u6A21\u5F0F",
300
+ description: "Suitable for daily development",
301
+ descriptionZh: "\u9002\u5408\u65E5\u5E38\u5F00\u53D1",
302
+ services: ["context7", "open-websearch", "mcp-deepwiki", "filesystem"],
303
+ maxServices: 5,
304
+ tier: "ondemand",
305
+ isDefault: true
306
+ },
307
+ {
308
+ id: "testing",
309
+ name: "Testing",
310
+ nameZh: "\u6D4B\u8BD5\u6A21\u5F0F",
311
+ description: "Includes browser automation",
312
+ descriptionZh: "\u5305\u542B\u6D4F\u89C8\u5668\u81EA\u52A8\u5316",
313
+ services: ["context7", "open-websearch", "Playwright"],
314
+ maxServices: 4,
315
+ tier: "ondemand"
316
+ },
317
+ {
318
+ id: "research",
319
+ name: "Research",
320
+ nameZh: "\u7814\u7A76\u6A21\u5F0F",
321
+ description: "Enhanced documentation and search",
322
+ descriptionZh: "\u589E\u5F3A\u6587\u6863\u548C\u641C\u7D22\u529F\u80FD",
323
+ services: ["context7", "open-websearch", "mcp-deepwiki", "memory", "sequential-thinking"],
324
+ maxServices: 6,
325
+ tier: "ondemand"
326
+ },
327
+ {
328
+ id: "full",
329
+ name: "Full",
330
+ nameZh: "\u5168\u529F\u80FD\u6A21\u5F0F",
331
+ description: "All services (high resource usage)",
332
+ descriptionZh: "\u6240\u6709\u670D\u52A1\uFF08\u9AD8\u8D44\u6E90\u6D88\u8017\uFF09",
333
+ services: [],
334
+ // Empty means all services
335
+ maxServices: void 0,
336
+ tier: "scenario"
337
+ }
338
+ ];
339
+ function getProfileById(id) {
340
+ return MCP_PROFILES.find((p) => p.id === id);
341
+ }
342
+ function getProfileIds() {
343
+ return MCP_PROFILES.map((p) => p.id);
344
+ }
345
+ function getProfileName(profile, lang = "en") {
346
+ return lang === "zh-CN" ? profile.nameZh : profile.name;
347
+ }
348
+ function getProfileDescription(profile, lang = "en") {
349
+ return lang === "zh-CN" ? profile.descriptionZh : profile.description;
350
+ }
351
+
352
+ async function listProfiles(options = {}) {
353
+ const lang = options.lang || i18n.language || "en";
354
+ const isZh = lang === "zh-CN";
355
+ console.log("");
356
+ console.log(ansis.bold.cyan(isZh ? "\u{1F4CB} \u53EF\u7528\u7684 MCP \u914D\u7F6E\u9884\u8BBE" : "\u{1F4CB} Available MCP Profiles"));
357
+ console.log(ansis.dim("\u2500".repeat(50)));
358
+ console.log("");
359
+ for (const profile of MCP_PROFILES) {
360
+ const name = getProfileName(profile, lang);
361
+ const desc = getProfileDescription(profile, lang);
362
+ const serviceCount = profile.services.length === 0 ? isZh ? "\u5168\u90E8" : "All" : profile.services.length.toString();
363
+ const defaultBadge = profile.isDefault ? ansis.green(isZh ? " [\u9ED8\u8BA4]" : " [default]") : "";
364
+ console.log(`${ansis.bold.green(profile.id)}${defaultBadge}`);
365
+ console.log(` ${ansis.white(name)} - ${ansis.dim(desc)}`);
366
+ console.log(` ${ansis.dim(isZh ? "\u670D\u52A1\u6570\u91CF" : "Services")}: ${serviceCount}`);
367
+ if (profile.services.length > 0 && profile.services.length <= 6) {
368
+ console.log(` ${ansis.dim(profile.services.join(", "))}`);
369
+ }
370
+ console.log("");
371
+ }
372
+ console.log(ansis.dim("\u2500".repeat(50)));
373
+ console.log(ansis.dim(isZh ? "\u4F7F\u7528 `ccjk mcp profile use <id>` \u5207\u6362\u914D\u7F6E" : "Use `ccjk mcp profile use <id>` to switch profile"));
374
+ console.log("");
375
+ }
376
+ async function useProfile(profileId, options = {}) {
377
+ const lang = options.lang || i18n.language || "en";
378
+ const isZh = lang === "zh-CN";
379
+ const profile = getProfileById(profileId);
380
+ if (!profile) {
381
+ console.log(ansis.red(isZh ? `\u274C \u672A\u627E\u5230\u914D\u7F6E\u9884\u8BBE: ${profileId}` : `\u274C Profile not found: ${profileId}`));
382
+ console.log(ansis.dim(isZh ? `\u53EF\u7528\u9884\u8BBE: ${getProfileIds().join(", ")}` : `Available profiles: ${getProfileIds().join(", ")}`));
383
+ return;
384
+ }
385
+ const backupPath = backupMcpConfig();
386
+ if (backupPath) {
387
+ console.log(ansis.gray(`\u2714 ${isZh ? "\u5DF2\u5907\u4EFD\u5F53\u524D\u914D\u7F6E" : "Backed up current config"}: ${backupPath}`));
388
+ }
389
+ let servicesToEnable;
390
+ if (profile.services.length === 0) {
391
+ servicesToEnable = MCP_SERVICE_CONFIGS.filter((s) => !s.requiresApiKey).map((s) => s.id);
392
+ } else {
393
+ servicesToEnable = profile.services;
394
+ }
395
+ const newServers = {};
396
+ for (const serviceId of servicesToEnable) {
397
+ const serviceConfig = MCP_SERVICE_CONFIGS.find((s) => s.id === serviceId);
398
+ if (serviceConfig) {
399
+ newServers[serviceId] = serviceConfig.config;
400
+ }
401
+ }
402
+ const existingConfig = readMcpConfig() || {};
403
+ const newConfig = {
404
+ ...existingConfig,
405
+ mcpServers: newServers
406
+ };
407
+ writeMcpConfig(newConfig);
408
+ const profileName = getProfileName(profile, lang);
409
+ console.log(ansis.green(`\u2714 ${isZh ? "\u5DF2\u5207\u6362\u5230\u914D\u7F6E\u9884\u8BBE" : "Switched to profile"}: ${profileName}`));
410
+ console.log(ansis.dim(` ${isZh ? "\u5DF2\u542F\u7528\u670D\u52A1" : "Enabled services"}: ${servicesToEnable.length}`));
411
+ const warning = checkMcpPerformance(servicesToEnable.length);
412
+ if (warning) {
413
+ console.log("");
414
+ console.log(formatPerformanceWarning(warning, lang));
415
+ }
416
+ console.log("");
417
+ console.log(ansis.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u91CD\u542F Claude Code \u4EE5\u4F7F\u66F4\u6539\u751F\u6548" : "\u26A0\uFE0F Please restart Claude Code for changes to take effect"));
418
+ }
419
+
420
+ async function mcpStatus(options = {}) {
421
+ const { readMcpConfig } = await import('./codex.mjs').then(function (n) { return n.ag; });
422
+ const { checkMcpPerformance, formatPerformanceWarning } = await import('./mcp-performance.mjs').then(function (n) { return n.e; });
423
+ const { MCP_SERVICE_TIERS } = await import('./mcp-performance.mjs').then(function (n) { return n.m; });
424
+ const lang = options.lang || i18n.language || "en";
425
+ const isZh = lang === "zh-CN";
426
+ console.log("");
427
+ console.log(ansis.bold.cyan(isZh ? "\u26A1 MCP \u5FEB\u901F\u72B6\u6001" : "\u26A1 MCP Quick Status"));
428
+ console.log(ansis.dim("\u2500".repeat(40)));
429
+ const config = await readMcpConfig();
430
+ const services = Object.keys(config?.mcpServers || {});
431
+ let coreCount = 0;
432
+ let ondemandCount = 0;
433
+ let scenarioCount = 0;
434
+ for (const svc of services) {
435
+ const tier = MCP_SERVICE_TIERS[svc] || "ondemand";
436
+ if (tier === "core")
437
+ coreCount++;
438
+ else if (tier === "ondemand")
439
+ ondemandCount++;
440
+ else scenarioCount++;
441
+ }
442
+ console.log("");
443
+ console.log(`${ansis.green("\u25CF")} ${isZh ? "\u6838\u5FC3\u670D\u52A1" : "Core"}: ${coreCount}`);
444
+ console.log(`${ansis.yellow("\u25CF")} ${isZh ? "\u6309\u9700\u670D\u52A1" : "On-demand"}: ${ondemandCount}`);
445
+ console.log(`${ansis.blue("\u25CF")} ${isZh ? "\u573A\u666F\u670D\u52A1" : "Scenario"}: ${scenarioCount}`);
446
+ console.log(`${ansis.dim("\u2500")} ${isZh ? "\u603B\u8BA1" : "Total"}: ${services.length}`);
447
+ const perfResult = checkMcpPerformance(services.length);
448
+ if (perfResult) {
449
+ console.log("");
450
+ console.log(formatPerformanceWarning(perfResult, lang));
451
+ } else {
452
+ console.log("");
453
+ console.log(ansis.green(isZh ? "\u2713 \u6027\u80FD\u72B6\u6001\u826F\u597D" : "\u2713 Performance OK"));
454
+ }
455
+ console.log("");
456
+ console.log(ansis.dim(isZh ? "\u63D0\u793A: \u4F7F\u7528 ccjk mcp doctor \u67E5\u770B\u8BE6\u7EC6\u8BCA\u65AD" : "Tip: Use ccjk mcp doctor for detailed diagnostics"));
457
+ }
458
+ function mcpHelp(options = {}) {
459
+ const lang = options.lang || i18n.language || "en";
460
+ const isZh = lang === "zh-CN";
461
+ console.log("");
462
+ console.log(ansis.bold.cyan(isZh ? "\u{1F527} MCP \u7BA1\u7406\u547D\u4EE4" : "\u{1F527} MCP Management Commands"));
463
+ console.log(ansis.dim("\u2500".repeat(50)));
464
+ console.log("");
465
+ const commands = [
466
+ {
467
+ cmd: "ccjk mcp status",
468
+ desc: isZh ? "\u5FEB\u901F\u67E5\u770B MCP \u72B6\u6001" : "Quick MCP status overview"
469
+ },
470
+ {
471
+ cmd: "ccjk mcp doctor",
472
+ desc: isZh ? "\u5065\u5EB7\u68C0\u67E5\u4E0E\u6027\u80FD\u8BCA\u65AD" : "Health check and diagnostics"
473
+ },
474
+ {
475
+ cmd: "ccjk mcp profile [name]",
476
+ desc: isZh ? "\u5207\u6362\u914D\u7F6E\u9884\u8BBE (minimal/dev/full)" : "Switch profile (minimal/dev/full)"
477
+ },
478
+ {
479
+ cmd: "ccjk mcp release",
480
+ desc: isZh ? "\u91CA\u653E\u95F2\u7F6E\u670D\u52A1" : "Release idle services"
481
+ },
482
+ {
483
+ cmd: "ccjk mcp market",
484
+ desc: isZh ? "MCP \u670D\u52A1\u5E02\u573A" : "MCP service marketplace"
485
+ },
486
+ {
487
+ cmd: "ccjk mcp list",
488
+ desc: isZh ? "\u5217\u51FA\u5DF2\u5B89\u88C5\u670D\u52A1" : "List installed services"
489
+ }
490
+ ];
491
+ for (const { cmd, desc } of commands) {
492
+ console.log(` ${ansis.green(cmd)}`);
493
+ console.log(` ${ansis.dim(desc)}`);
494
+ console.log("");
495
+ }
496
+ console.log(ansis.dim("\u2500".repeat(50)));
497
+ console.log(ansis.dim(isZh ? "\u{1F4A1} \u63A8\u8350: \u4F7F\u7528 minimal \u9884\u8BBE\u53EF\u663E\u8457\u63D0\u5347\u6027\u80FD" : "\u{1F4A1} Tip: Use minimal profile for best performance"));
498
+ }
499
+
500
+ export { listProfiles, mcpDoctor, mcpHelp, mcpRelease, mcpStatus, useProfile };
@@ -1,16 +1,16 @@
1
1
  import { existsSync } from 'node:fs';
2
- import process from 'node:process';
2
+ import process__default from 'node:process';
3
3
  import ansis from 'ansis';
4
4
  import inquirer from 'inquirer';
5
5
  import { join } from 'pathe';
6
6
  import { CODE_TOOL_BANNERS, CLAUDE_DIR, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
7
7
  import { ensureI18nInitialized, i18n } from './index2.mjs';
8
8
  import { a as displayBannerWithInfo } from '../shared/ccjk.BhKlRJ0h.mjs';
9
- import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
- import { E as runCodexUpdate, D as runCodexUninstall, M as configureCodexMcp, j as configureCodexApi, G as runCodexWorkflowImportWithLanguageSelection, B as runCodexFullInit } from './codex.mjs';
11
- import { r as resolveCodeType } from '../shared/ccjk.CUdzQluX.mjs';
12
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.B7169qud.mjs';
13
- import { changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features2.mjs';
9
+ import { u as updateZcfConfig, a as readZcfConfig } from './ccjk-config.mjs';
10
+ import { Q as runCodexUpdate, P as runCodexUninstall, Y as configureCodexMcp, z as configureCodexApi, S as runCodexWorkflowImportWithLanguageSelection, N as runCodexFullInit } from './codex.mjs';
11
+ import { r as resolveCodeType } from '../shared/ccjk.CURU8gbR.mjs';
12
+ import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.tB4-Y4Qb.mjs';
13
+ import { changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features.mjs';
14
14
  import { c as checkForUpdates, g as getInstalledPackages, s as searchPackages } from '../shared/ccjk.Bi-m3LKY.mjs';
15
15
  import { p as promptBoolean, a as addNumbersToChoices } from '../shared/ccjk.DhBeLRzf.mjs';
16
16
  import { isSmartGuideInstalled, generateSkillReferenceCard, removeSmartGuide, injectSmartGuide, generateQuickActionsPanel, QUICK_ACTIONS } from './smart-guide.mjs';
@@ -19,13 +19,13 @@ import { spawn, exec } from 'node:child_process';
19
19
  import { promisify } from 'node:util';
20
20
  import { C as COMETIX_COMMAND_NAME, n as COMETIX_COMMANDS, o as installCometixLine, p as readCcrConfig, q as isCcrInstalled, t as installCcr, w as configureCcrFeature, i as init, x as checkSuperpowersInstalled, y as getSuperpowersSkills, z as updateSuperpowers, A as uninstallSuperpowers, B as installSuperpowers, D as installSuperpowersViaGit } from './init.mjs';
21
21
  import { homedir } from 'node:os';
22
- import { runCcrStop, runCcrStart, runCcrRestart, runCcrStatus, runCcrUi } from './commands.mjs';
22
+ import { runCcrStop, runCcrStart, runCcrRestart, runCcrStatus, runCcrUi } from './commands2.mjs';
23
23
  import { checkUpdates } from './check-updates.mjs';
24
24
  import { configSwitchCommand } from './config-switch.mjs';
25
- import { d as detectProjectContext, h as getProjectTypeLabel, b as getApplicableRules, c as getContextFiles, j as getContextFileTypeLabel, r as readContextFile, m as mergeContextContent, e as generateContextContent, w as writeContextFile, f as getRecommendedRules, k as formatFileSize } from '../shared/ccjk.DJM5aVQJ.mjs';
25
+ import { d as detectProjectContext, h as getProjectTypeLabel, b as getApplicableRules, c as getContextFiles, j as getContextFileTypeLabel, r as readContextFile, m as mergeContextContent, e as generateContextContent, w as writeContextFile, f as getRecommendedRules, k as formatFileSize } from '../shared/ccjk.ByTIGCUC.mjs';
26
26
  import { doctor, workspaceDiagnostics } from './doctor.mjs';
27
27
  import { ensureDir, writeFileAtomic, exists, readJsonFile } from './fs-operations.mjs';
28
- import { mcpList, mcpUninstall, mcpInstall, mcpTrending, mcpSearch } from './mcp-market.mjs';
28
+ import { a as mcpList, c as mcpUninstall, m as mcpInstall, d as mcpTrending, b as mcpSearch } from '../shared/ccjk.D-RZS4E2.mjs';
29
29
  import { notificationCommand } from './notification.mjs';
30
30
  import { uninstall } from './uninstall.mjs';
31
31
  import { update } from './update.mjs';
@@ -3589,7 +3589,7 @@ async function showMainMenu(options = {}) {
3589
3589
  console.error(ansis.yellow(errorMessage));
3590
3590
  }
3591
3591
  }
3592
- const useLegacyMenu = options.legacyMenu || process.env.CCJK_LEGACY_MENU === "1";
3592
+ const useLegacyMenu = options.legacyMenu || process__default.env.CCJK_LEGACY_MENU === "1";
3593
3593
  let exitMenu = false;
3594
3594
  while (!exitMenu) {
3595
3595
  const codeTool = getCurrentCodeTool();
@@ -12,7 +12,7 @@ import crypto from 'node:crypto';
12
12
  import { exec } from 'node:child_process';
13
13
  import * as path from 'node:path';
14
14
  import path__default from 'node:path';
15
- import process from 'node:process';
15
+ import process__default from 'node:process';
16
16
  import { promisify } from 'node:util';
17
17
  import { parse, stringify } from '@iarna/toml';
18
18
  import 'node:url';
@@ -534,7 +534,7 @@ class LocalNotificationService {
534
534
  * @returns true if screen is locked, false otherwise
535
535
  */
536
536
  async isScreenLocked() {
537
- if (process.platform !== "darwin") {
537
+ if (process__default.platform !== "darwin") {
538
538
  return false;
539
539
  }
540
540
  try {
@@ -569,7 +569,7 @@ else:
569
569
  * @param options - Notification options
570
570
  */
571
571
  async sendShortcutNotification(shortcutName, options) {
572
- if (process.platform !== "darwin") {
572
+ if (process__default.platform !== "darwin") {
573
573
  throw new Error("macOS Shortcuts are only available on macOS");
574
574
  }
575
575
  const notificationData = {
@@ -779,7 +779,7 @@ async function getLocalNotificationService() {
779
779
  return serviceInstance;
780
780
  }
781
781
  async function isShortcutsAvailable() {
782
- if (process.platform !== "darwin") {
782
+ if (process__default.platform !== "darwin") {
783
783
  return false;
784
784
  }
785
785
  try {
@@ -790,7 +790,7 @@ async function isShortcutsAvailable() {
790
790
  }
791
791
  }
792
792
  async function listShortcuts() {
793
- if (process.platform !== "darwin") {
793
+ if (process__default.platform !== "darwin") {
794
794
  return [];
795
795
  }
796
796
  try {
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync, readdirSync, mkdirSync, statSync } from 'node:fs';
2
- import process from 'node:process';
2
+ import process__default from 'node:process';
3
3
  import ansis from 'ansis';
4
4
  import dayjs from 'dayjs';
5
5
  import inquirer from 'inquirer';
@@ -238,7 +238,7 @@ function determineProjectType(info) {
238
238
  return "backend";
239
239
  return "unknown";
240
240
  }
241
- function detectProject(dir = process.cwd()) {
241
+ function detectProject(dir = process__default.cwd()) {
242
242
  const pkg = readPackageJson(dir);
243
243
  const frameworks = detectFrameworks(dir);
244
244
  const languages = detectLanguages(dir);
@@ -517,7 +517,7 @@ ${project.buildTools.length > 0 ? `Build tools: ${project.buildTools.join(", ")}
517
517
  *Generated by CCJK on ${dayjs().format("YYYY-MM-DD")}*
518
518
  `;
519
519
  }
520
- async function runOnboarding(projectDir = process.cwd()) {
520
+ async function runOnboarding(projectDir = process__default.cwd()) {
521
521
  console.log(boxify(`
522
522
  Welcome to CCJK!
523
523
 
@@ -670,7 +670,7 @@ async function runOnboarding(projectDir = process.cwd()) {
670
670
  result.success = true;
671
671
  return result;
672
672
  }
673
- async function quickSync(projectDir = process.cwd()) {
673
+ async function quickSync(projectDir = process__default.cwd()) {
674
674
  const spinner = ora("Syncing project knowledge...").start();
675
675
  const kb = loadKnowledgeBase();
676
676
  detectProject(projectDir);
@@ -689,11 +689,11 @@ async function quickSync(projectDir = process.cwd()) {
689
689
  saveKnowledgeBase(kb);
690
690
  spinner.succeed(`Synced: ${claudeMd ? 1 : 0} CLAUDE.md, ${agents.length} agents, ${skills.length} skills`);
691
691
  }
692
- function getProjectKnowledge(projectDir = process.cwd()) {
692
+ function getProjectKnowledge(projectDir = process__default.cwd()) {
693
693
  const kb = loadKnowledgeBase();
694
694
  return kb.entries.filter((e) => e.projectRoot === projectDir);
695
695
  }
696
- function exportProjectKnowledge(projectDir = process.cwd()) {
696
+ function exportProjectKnowledge(projectDir = process__default.cwd()) {
697
697
  const entries = getProjectKnowledge(projectDir);
698
698
  return JSON.stringify(entries, null, 2);
699
699
  }
@@ -1,4 +1,4 @@
1
- const version = "2.2.2";
1
+ const version = "2.2.5";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };