ccjk 2.0.20 → 2.2.1

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 (71) hide show
  1. package/README.md +601 -35
  2. package/README.zh-CN.md +651 -0
  3. package/dist/chunks/api.mjs +100 -0
  4. package/dist/chunks/auto-updater.mjs +252 -0
  5. package/dist/chunks/ccjk-config.mjs +261 -0
  6. package/dist/chunks/ccr.mjs +77 -0
  7. package/dist/chunks/ccu.mjs +36 -0
  8. package/dist/chunks/check-updates.mjs +93 -0
  9. package/dist/chunks/claude-code-config-manager.mjs +28 -21
  10. package/dist/chunks/claude-code-incremental-manager.mjs +26 -18
  11. package/dist/chunks/claude-config.mjs +228 -0
  12. package/dist/chunks/codex.mjs +2134 -0
  13. package/dist/chunks/commands.mjs +2 -15
  14. package/dist/chunks/commit.mjs +119 -0
  15. package/dist/chunks/config-consolidator.mjs +281 -0
  16. package/dist/chunks/config-switch.mjs +302 -0
  17. package/dist/chunks/constants.mjs +156 -0
  18. package/dist/chunks/doctor.mjs +708 -0
  19. package/dist/chunks/features.mjs +35 -640
  20. package/dist/chunks/features2.mjs +661 -0
  21. package/dist/chunks/fs-operations.mjs +180 -0
  22. package/dist/chunks/index.mjs +3082 -0
  23. package/dist/chunks/index2.mjs +145 -0
  24. package/dist/chunks/init.mjs +2468 -0
  25. package/dist/chunks/interview.mjs +2916 -0
  26. package/dist/chunks/json-config.mjs +59 -0
  27. package/dist/chunks/marketplace.mjs +258 -0
  28. package/dist/chunks/mcp-doctor.mjs +160 -0
  29. package/dist/chunks/mcp-market.mjs +475 -0
  30. package/dist/chunks/mcp-performance.mjs +110 -0
  31. package/dist/chunks/mcp-profile.mjs +220 -0
  32. package/dist/chunks/mcp-release.mjs +138 -0
  33. package/dist/chunks/menu.mjs +3599 -0
  34. package/dist/chunks/notification.mjs +2336 -0
  35. package/dist/chunks/onboarding.mjs +711 -0
  36. package/dist/chunks/package.mjs +4 -0
  37. package/dist/chunks/permission-manager.mjs +210 -0
  38. package/dist/chunks/platform.mjs +321 -0
  39. package/dist/chunks/prompts.mjs +228 -0
  40. package/dist/chunks/session.mjs +355 -0
  41. package/dist/chunks/shencha.mjs +320 -0
  42. package/dist/chunks/skills-sync.mjs +4 -13
  43. package/dist/chunks/team.mjs +51 -0
  44. package/dist/chunks/tools.mjs +169 -0
  45. package/dist/chunks/uninstall.mjs +784 -0
  46. package/dist/chunks/update.mjs +104 -0
  47. package/dist/chunks/upgrade-manager.mjs +197 -0
  48. package/dist/chunks/workflows.mjs +100 -0
  49. package/dist/cli.mjs +581 -15348
  50. package/dist/i18n/locales/zh-CN/cli.json +1 -1
  51. package/dist/i18n/locales/zh-CN/common.json +1 -1
  52. package/dist/index.mjs +43 -2062
  53. package/dist/shared/ccjk.-FoZ3zat.mjs +761 -0
  54. package/dist/shared/ccjk.B7169qud.mjs +25 -0
  55. package/dist/shared/ccjk.BhKlRJ0h.mjs +114 -0
  56. package/dist/shared/ccjk.Bi-m3LKY.mjs +357 -0
  57. package/dist/shared/ccjk.COdsoe-Y.mjs +64 -0
  58. package/dist/shared/ccjk.CUdzQluX.mjs +46 -0
  59. package/dist/shared/ccjk.Cy-RH2qV.mjs +506 -0
  60. package/dist/shared/ccjk.DGjQxTq_.mjs +34 -0
  61. package/dist/shared/ccjk.DJM5aVQJ.mjs +586 -0
  62. package/dist/shared/ccjk.DhBeLRzf.mjs +28 -0
  63. package/dist/shared/ccjk.DwDtZ5cK.mjs +266 -0
  64. package/dist/shared/ccjk.n_AtlHzB.mjs +186 -0
  65. package/dist/shared/ccjk.qYAnUMuy.mjs +749 -0
  66. package/package.json +29 -25
  67. package/dist/chunks/codex-config-switch.mjs +0 -429
  68. package/dist/chunks/codex-provider-manager.mjs +0 -234
  69. package/dist/chunks/codex-uninstaller.mjs +0 -406
  70. package/dist/chunks/plugin-recommendation.mjs +0 -575
  71. package/dist/chunks/simple-config.mjs +0 -10950
@@ -0,0 +1,266 @@
1
+ import 'node:child_process';
2
+ import { homedir } from 'node:os';
3
+ import 'node:process';
4
+ import { join } from 'pathe';
5
+ import { ensureI18nInitialized, i18n } from '../chunks/index2.mjs';
6
+
7
+ const PLAYWRIGHT_PROFILES_DIR = join(homedir(), ".ccjk", "playwright");
8
+ function createPlaywrightMcpConfig(options = {}) {
9
+ const {
10
+ profile = "default",
11
+ headless = false,
12
+ browser = "chromium",
13
+ userDataDir
14
+ } = options;
15
+ const resolvedUserDataDir = userDataDir || join(PLAYWRIGHT_PROFILES_DIR, profile);
16
+ const args = ["-y", "@playwright/mcp@latest"];
17
+ args.push("--browser", browser);
18
+ args.push("--user-data-dir", resolvedUserDataDir);
19
+ if (headless) {
20
+ args.push("--headless");
21
+ }
22
+ return {
23
+ type: "stdio",
24
+ command: "npx",
25
+ args,
26
+ env: {}
27
+ };
28
+ }
29
+ const MCP_SERVICE_CONFIGS = [
30
+ // Documentation and Search Services - Universal (no GUI required)
31
+ {
32
+ id: "context7",
33
+ requiresApiKey: false,
34
+ config: {
35
+ type: "stdio",
36
+ command: "npx",
37
+ args: ["-y", "@upstash/context7-mcp@latest"],
38
+ env: {}
39
+ }
40
+ // Works on all platforms - no special requirements
41
+ },
42
+ {
43
+ id: "open-websearch",
44
+ requiresApiKey: false,
45
+ config: {
46
+ type: "stdio",
47
+ command: "npx",
48
+ args: ["-y", "open-websearch@latest"],
49
+ env: {
50
+ MODE: "stdio",
51
+ DEFAULT_SEARCH_ENGINE: "duckduckgo",
52
+ ALLOWED_SEARCH_ENGINES: "duckduckgo,bing,brave"
53
+ }
54
+ }
55
+ // Works on all platforms - no special requirements
56
+ },
57
+ {
58
+ id: "mcp-deepwiki",
59
+ requiresApiKey: false,
60
+ config: {
61
+ type: "stdio",
62
+ command: "npx",
63
+ args: ["-y", "mcp-deepwiki@latest"],
64
+ env: {}
65
+ }
66
+ // Works on all platforms - no special requirements
67
+ },
68
+ // Development Workflow Services
69
+ {
70
+ id: "spec-workflow",
71
+ requiresApiKey: false,
72
+ config: {
73
+ type: "stdio",
74
+ command: "npx",
75
+ args: ["-y", "@pimzino/spec-workflow-mcp@latest"],
76
+ env: {}
77
+ }
78
+ // Works on all platforms - no special requirements
79
+ },
80
+ {
81
+ id: "serena",
82
+ requiresApiKey: false,
83
+ config: {
84
+ type: "stdio",
85
+ command: "uvx",
86
+ args: ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "ide-assistant", "--enable-web-dashboard", "false"],
87
+ env: {}
88
+ },
89
+ platformRequirements: {
90
+ requiredCommands: ["uvx"]
91
+ // Requires uv/uvx to be installed
92
+ }
93
+ },
94
+ // Browser and Automation Services - Require GUI environment
95
+ {
96
+ id: "Playwright",
97
+ requiresApiKey: false,
98
+ config: createPlaywrightMcpConfig(),
99
+ // Uses default profile with chromium browser
100
+ platformRequirements: {
101
+ platforms: ["macos", "windows"],
102
+ // GUI required - exclude headless Linux/WSL/Termux
103
+ requiresGui: true
104
+ }
105
+ },
106
+ {
107
+ id: "puppeteer",
108
+ requiresApiKey: false,
109
+ config: {
110
+ type: "stdio",
111
+ command: "npx",
112
+ args: ["-y", "@anthropic-ai/mcp-server-puppeteer@latest"],
113
+ env: {}
114
+ },
115
+ platformRequirements: {
116
+ platforms: ["macos", "windows"],
117
+ // GUI required - exclude headless Linux/WSL/Termux
118
+ requiresGui: true
119
+ }
120
+ },
121
+ // Anthropic Official MCP Services - Universal
122
+ {
123
+ id: "filesystem",
124
+ requiresApiKey: false,
125
+ config: {
126
+ type: "stdio",
127
+ command: "npx",
128
+ args: ["-y", "@anthropic-ai/mcp-server-filesystem@latest", "."],
129
+ env: {}
130
+ }
131
+ // Works on all platforms - no special requirements
132
+ },
133
+ {
134
+ id: "memory",
135
+ requiresApiKey: false,
136
+ config: {
137
+ type: "stdio",
138
+ command: "npx",
139
+ args: ["-y", "@anthropic-ai/mcp-server-memory@latest"],
140
+ env: {}
141
+ }
142
+ // Works on all platforms - no special requirements
143
+ },
144
+ {
145
+ id: "sequential-thinking",
146
+ requiresApiKey: false,
147
+ config: {
148
+ type: "stdio",
149
+ command: "npx",
150
+ args: ["-y", "@anthropic-ai/mcp-server-sequential-thinking@latest"],
151
+ env: {}
152
+ }
153
+ // Works on all platforms - no special requirements
154
+ },
155
+ {
156
+ id: "fetch",
157
+ requiresApiKey: false,
158
+ config: {
159
+ type: "stdio",
160
+ command: "npx",
161
+ args: ["-y", "@anthropic-ai/mcp-server-fetch@latest"],
162
+ env: {}
163
+ }
164
+ // Works on all platforms - no special requirements
165
+ },
166
+ {
167
+ id: "sqlite",
168
+ requiresApiKey: false,
169
+ config: {
170
+ type: "stdio",
171
+ command: "npx",
172
+ args: ["-y", "@anthropic-ai/mcp-server-sqlite@latest"],
173
+ env: {}
174
+ }
175
+ // Works on all platforms - no special requirements
176
+ }
177
+ ];
178
+ async function getMcpServices() {
179
+ ensureI18nInitialized();
180
+ const mcpServiceList = [
181
+ // Documentation and Search Services
182
+ {
183
+ id: "context7",
184
+ name: i18n.t("mcp:services.context7.name"),
185
+ description: i18n.t("mcp:services.context7.description")
186
+ },
187
+ {
188
+ id: "open-websearch",
189
+ name: i18n.t("mcp:services.open-websearch.name"),
190
+ description: i18n.t("mcp:services.open-websearch.description")
191
+ },
192
+ {
193
+ id: "mcp-deepwiki",
194
+ name: i18n.t("mcp:services.mcp-deepwiki.name"),
195
+ description: i18n.t("mcp:services.mcp-deepwiki.description")
196
+ },
197
+ // Development Workflow Services
198
+ {
199
+ id: "spec-workflow",
200
+ name: i18n.t("mcp:services.spec-workflow.name"),
201
+ description: i18n.t("mcp:services.spec-workflow.description")
202
+ },
203
+ {
204
+ id: "serena",
205
+ name: i18n.t("mcp:services.serena.name"),
206
+ description: i18n.t("mcp:services.serena.description")
207
+ },
208
+ // Browser and Automation Services
209
+ {
210
+ id: "Playwright",
211
+ name: i18n.t("mcp:services.playwright.name"),
212
+ description: i18n.t("mcp:services.playwright.description")
213
+ },
214
+ {
215
+ id: "puppeteer",
216
+ name: i18n.t("mcp:services.puppeteer.name"),
217
+ description: i18n.t("mcp:services.puppeteer.description")
218
+ },
219
+ // Anthropic Official MCP Services
220
+ {
221
+ id: "filesystem",
222
+ name: i18n.t("mcp:services.filesystem.name"),
223
+ description: i18n.t("mcp:services.filesystem.description")
224
+ },
225
+ {
226
+ id: "memory",
227
+ name: i18n.t("mcp:services.memory.name"),
228
+ description: i18n.t("mcp:services.memory.description")
229
+ },
230
+ {
231
+ id: "sequential-thinking",
232
+ name: i18n.t("mcp:services.sequential-thinking.name"),
233
+ description: i18n.t("mcp:services.sequential-thinking.description")
234
+ },
235
+ {
236
+ id: "fetch",
237
+ name: i18n.t("mcp:services.fetch.name"),
238
+ description: i18n.t("mcp:services.fetch.description")
239
+ },
240
+ {
241
+ id: "sqlite",
242
+ name: i18n.t("mcp:services.sqlite.name"),
243
+ description: i18n.t("mcp:services.sqlite.description")
244
+ }
245
+ ];
246
+ return MCP_SERVICE_CONFIGS.map((config) => {
247
+ const serviceInfo = mcpServiceList.find((s) => s.id === config.id);
248
+ const service = {
249
+ id: config.id,
250
+ name: serviceInfo?.name || config.id,
251
+ description: serviceInfo?.description || "",
252
+ requiresApiKey: config.requiresApiKey,
253
+ config: config.config
254
+ };
255
+ if (config.apiKeyEnvVar) {
256
+ service.apiKeyEnvVar = config.apiKeyEnvVar;
257
+ }
258
+ return service;
259
+ });
260
+ }
261
+ async function getMcpService(id) {
262
+ const services = await getMcpServices();
263
+ return services.find((service) => service.id === id);
264
+ }
265
+
266
+ export { MCP_SERVICE_CONFIGS as M, getMcpService as a, getMcpServices as g };
@@ -0,0 +1,186 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { exec } from 'tinyexec';
3
+ import { CODE_TOOL_TYPES, CODE_TOOL_INFO, CLINE_DIR, CONTINUE_DIR, CURSOR_CONFIG_FILE, CLINE_CONFIG_FILE, CONTINUE_CONFIG_FILE, AIDER_CONFIG_FILE, CODEX_CONFIG_FILE, CLAUDE_DIR, CURSOR_DIR, AIDER_DIR, CODEX_DIR } from '../chunks/constants.mjs';
4
+
5
+ function getToolConfigPath(tool) {
6
+ switch (tool) {
7
+ case "claude-code":
8
+ return CLAUDE_DIR;
9
+ case "codex":
10
+ return CODEX_CONFIG_FILE;
11
+ case "aider":
12
+ return AIDER_CONFIG_FILE;
13
+ case "continue":
14
+ return CONTINUE_CONFIG_FILE;
15
+ case "cline":
16
+ return CLINE_CONFIG_FILE;
17
+ case "cursor":
18
+ return CURSOR_CONFIG_FILE;
19
+ default:
20
+ return "";
21
+ }
22
+ }
23
+ function getToolDir(tool) {
24
+ switch (tool) {
25
+ case "claude-code":
26
+ return CLAUDE_DIR;
27
+ case "codex":
28
+ return CODEX_DIR;
29
+ case "aider":
30
+ return AIDER_DIR;
31
+ case "continue":
32
+ return CONTINUE_DIR;
33
+ case "cline":
34
+ return CLINE_DIR;
35
+ case "cursor":
36
+ return CURSOR_DIR;
37
+ default:
38
+ return "";
39
+ }
40
+ }
41
+ async function isToolInstalled(tool) {
42
+ try {
43
+ switch (tool) {
44
+ case "claude-code": {
45
+ const ccResult = await exec("claude", ["--version"]);
46
+ return ccResult.exitCode === 0;
47
+ }
48
+ case "codex": {
49
+ const cxResult = await exec("codex", ["--version"]);
50
+ return cxResult.exitCode === 0;
51
+ }
52
+ case "aider": {
53
+ const adResult = await exec("aider", ["--version"]);
54
+ return adResult.exitCode === 0;
55
+ }
56
+ case "continue":
57
+ return existsSync(CONTINUE_DIR);
58
+ case "cline":
59
+ return existsSync(CLINE_DIR);
60
+ case "cursor": {
61
+ const cuResult = await exec("cursor", ["--version"]);
62
+ return cuResult.exitCode === 0;
63
+ }
64
+ default:
65
+ return false;
66
+ }
67
+ } catch {
68
+ return false;
69
+ }
70
+ }
71
+ async function getToolVersion(tool) {
72
+ try {
73
+ switch (tool) {
74
+ case "claude-code": {
75
+ const result = await exec("claude", ["--version"]);
76
+ return result.stdout.trim();
77
+ }
78
+ case "codex": {
79
+ const result = await exec("codex", ["--version"]);
80
+ return result.stdout.trim();
81
+ }
82
+ case "aider": {
83
+ const result = await exec("aider", ["--version"]);
84
+ return result.stdout.trim();
85
+ }
86
+ case "cursor": {
87
+ const result = await exec("cursor", ["--version"]);
88
+ return result.stdout.trim();
89
+ }
90
+ default:
91
+ return null;
92
+ }
93
+ } catch {
94
+ return null;
95
+ }
96
+ }
97
+ async function getToolStatus(tool) {
98
+ const configPath = getToolConfigPath(tool);
99
+ const installed = await isToolInstalled(tool);
100
+ const version = installed ? await getToolVersion(tool) : void 0;
101
+ return {
102
+ tool,
103
+ installed,
104
+ version: version || void 0,
105
+ configExists: existsSync(configPath),
106
+ configPath,
107
+ lastChecked: /* @__PURE__ */ new Date()
108
+ };
109
+ }
110
+ async function getAllToolsStatus() {
111
+ const statuses = [];
112
+ for (const tool of CODE_TOOL_TYPES) {
113
+ statuses.push(await getToolStatus(tool));
114
+ }
115
+ return statuses;
116
+ }
117
+ async function getInstalledTools() {
118
+ const installed = [];
119
+ for (const tool of CODE_TOOL_TYPES) {
120
+ if (await isToolInstalled(tool)) {
121
+ installed.push(tool);
122
+ }
123
+ }
124
+ return installed;
125
+ }
126
+ async function installTool(tool) {
127
+ const info = CODE_TOOL_INFO[tool];
128
+ try {
129
+ const parts = info.installCmd.split(" ");
130
+ const cmd = parts[0];
131
+ const args = parts.slice(1);
132
+ const result = await exec(cmd, args);
133
+ if (result.exitCode === 0) {
134
+ const version = await getToolVersion(tool);
135
+ return {
136
+ tool,
137
+ success: true,
138
+ message: `${info.name} installed successfully`,
139
+ version: version || void 0
140
+ };
141
+ } else {
142
+ return {
143
+ tool,
144
+ success: false,
145
+ message: `Failed to install ${info.name}: ${result.stderr}`
146
+ };
147
+ }
148
+ } catch (error) {
149
+ return {
150
+ tool,
151
+ success: false,
152
+ message: `Failed to install ${info.name}: ${error instanceof Error ? error.message : "Unknown error"}`
153
+ };
154
+ }
155
+ }
156
+ function getToolInfo(tool) {
157
+ return CODE_TOOL_INFO[tool];
158
+ }
159
+ function getAllToolsInfo() {
160
+ return CODE_TOOL_INFO;
161
+ }
162
+ function getToolsByCategory(category) {
163
+ return CODE_TOOL_TYPES.filter((tool) => CODE_TOOL_INFO[tool].category === category);
164
+ }
165
+ function formatToolStatus(status) {
166
+ const info = CODE_TOOL_INFO[status.tool];
167
+ const icon = status.installed ? "\u2705" : "\u274C";
168
+ const version = status.version ? ` (${status.version})` : "";
169
+ const config = status.configExists ? "\u{1F4C4}" : "\u26A0\uFE0F";
170
+ return `${icon} ${info.name}${version} ${config}`;
171
+ }
172
+ function getRecommendedTools(projectType) {
173
+ switch (projectType) {
174
+ case "typescript":
175
+ case "javascript":
176
+ return ["claude-code", "aider", "continue"];
177
+ case "python":
178
+ return ["aider", "continue", "claude-code"];
179
+ case "fullstack":
180
+ return ["claude-code", "cursor", "aider"];
181
+ default:
182
+ return ["claude-code", "aider"];
183
+ }
184
+ }
185
+
186
+ export { getToolDir as a, getToolVersion as b, getToolStatus as c, getAllToolsStatus as d, getInstalledTools as e, installTool as f, getToolConfigPath as g, getToolInfo as h, isToolInstalled as i, getAllToolsInfo as j, getToolsByCategory as k, formatToolStatus as l, getRecommendedTools as m };