ccjk 2.0.8 → 2.0.9
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/README.md +48 -2
- package/dist/chunks/claude-code-config-manager.mjs +8 -8
- package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
- package/dist/chunks/codex-config-switch.mjs +4 -4
- package/dist/chunks/codex-provider-manager.mjs +2 -2
- package/dist/chunks/codex-uninstaller.mjs +3 -3
- package/dist/chunks/commands.mjs +2 -2
- package/dist/chunks/features.mjs +11 -11
- package/dist/chunks/plugin-recommendation.mjs +555 -0
- package/dist/chunks/simple-config.mjs +227 -87
- package/dist/chunks/skills-sync.mjs +854 -0
- package/dist/cli.mjs +12580 -6948
- package/dist/i18n/locales/en/agents.json +135 -0
- package/dist/i18n/locales/en/claude-md.json +73 -0
- package/dist/i18n/locales/en/cloudPlugins.json +118 -0
- package/dist/i18n/locales/en/common.json +2 -1
- package/dist/i18n/locales/en/hooksSync.json +111 -0
- package/dist/i18n/locales/en/mcp.json +31 -6
- package/dist/i18n/locales/en/menu.json +60 -1
- package/dist/i18n/locales/en/notification.json +170 -1
- package/dist/i18n/locales/en/plugins.json +133 -0
- package/dist/i18n/locales/en/skillsSync.json +74 -0
- package/dist/i18n/locales/zh-CN/agents.json +135 -0
- package/dist/i18n/locales/zh-CN/claude-md.json +73 -0
- package/dist/i18n/locales/zh-CN/cloudPlugins.json +118 -0
- package/dist/i18n/locales/zh-CN/common.json +2 -1
- package/dist/i18n/locales/zh-CN/hooksSync.json +111 -0
- package/dist/i18n/locales/zh-CN/mcp.json +31 -6
- package/dist/i18n/locales/zh-CN/menu.json +60 -1
- package/dist/i18n/locales/zh-CN/notification.json +170 -1
- package/dist/i18n/locales/zh-CN/plugins.json +133 -0
- package/dist/i18n/locales/zh-CN/skillsSync.json +74 -0
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +190 -188
- package/package.json +52 -49
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as nodeFs from 'node:fs';
|
|
2
2
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, copyFileSync, rmSync, rmdirSync, readdirSync, statSync, unlinkSync, renameSync } from 'node:fs';
|
|
3
|
-
import process
|
|
3
|
+
import process from 'node:process';
|
|
4
4
|
import ansis from 'ansis';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
|
+
import { homedir, platform as platform$1 } from 'node:os';
|
|
6
7
|
import { dirname, join, basename } from 'pathe';
|
|
7
8
|
import { parse, stringify } from 'smol-toml';
|
|
8
9
|
import dayjs from 'dayjs';
|
|
9
10
|
import { exec as exec$1 } from 'node:child_process';
|
|
10
|
-
import { homedir, platform as platform$1 } from 'node:os';
|
|
11
11
|
import { promisify } from 'node:util';
|
|
12
12
|
import { fileURLToPath } from 'node:url';
|
|
13
13
|
import toggleModule from 'inquirer-toggle';
|
|
@@ -20,7 +20,7 @@ import trash from 'trash';
|
|
|
20
20
|
import i18next from 'i18next';
|
|
21
21
|
import Backend from 'i18next-fs-backend';
|
|
22
22
|
|
|
23
|
-
const version = "2.0.
|
|
23
|
+
const version = "2.0.9";
|
|
24
24
|
const homepage = "https://github.com/miounet11/ccjk";
|
|
25
25
|
|
|
26
26
|
const i18n = i18next.createInstance();
|
|
@@ -31,6 +31,8 @@ const NAMESPACES = [
|
|
|
31
31
|
"ccjk",
|
|
32
32
|
// CCJK-specific translations
|
|
33
33
|
"cli",
|
|
34
|
+
"cloudPlugins",
|
|
35
|
+
// Cloud-based plugin system
|
|
34
36
|
"cometix",
|
|
35
37
|
"codex",
|
|
36
38
|
"configuration",
|
|
@@ -46,9 +48,13 @@ const NAMESPACES = [
|
|
|
46
48
|
"multi-config",
|
|
47
49
|
"notification",
|
|
48
50
|
// Task completion notifications
|
|
51
|
+
"plugins",
|
|
52
|
+
// Cloud plugins management
|
|
49
53
|
"shencha",
|
|
50
54
|
"skills",
|
|
51
55
|
// Skills management system
|
|
56
|
+
"skillsSync",
|
|
57
|
+
// Skills cloud synchronization
|
|
52
58
|
"smartGuide",
|
|
53
59
|
// Smart Guide for quick actions
|
|
54
60
|
"superpowers",
|
|
@@ -100,7 +106,7 @@ async function initI18n(language = "zh-CN") {
|
|
|
100
106
|
// Development: src/i18n/locales
|
|
101
107
|
join(packageRoot, "dist/i18n/locales"),
|
|
102
108
|
// NPM package: /node_modules/ccjk/dist/i18n/locales
|
|
103
|
-
join(process
|
|
109
|
+
join(process.cwd(), "dist/i18n/locales"),
|
|
104
110
|
// Production build: ./dist/i18n/locales
|
|
105
111
|
join(currentDir, "../../../dist/i18n/locales"),
|
|
106
112
|
// Fallback for deep chunk paths
|
|
@@ -113,7 +119,7 @@ async function initI18n(language = "zh-CN") {
|
|
|
113
119
|
return join(basePath, "{{lng}}/{{ns}}.json");
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
|
-
return join(process
|
|
122
|
+
return join(process.cwd(), "dist/i18n/locales/{{lng}}/{{ns}}.json");
|
|
117
123
|
})()
|
|
118
124
|
},
|
|
119
125
|
// Interpolation settings
|
|
@@ -143,17 +149,49 @@ function format(template, values) {
|
|
|
143
149
|
async function changeLanguage(lng) {
|
|
144
150
|
await i18n.changeLanguage(lng);
|
|
145
151
|
}
|
|
152
|
+
function getTranslation(_lang) {
|
|
153
|
+
return (key, options) => {
|
|
154
|
+
if (key.includes(":")) {
|
|
155
|
+
return i18n.t(key, options);
|
|
156
|
+
}
|
|
157
|
+
return i18n.t(`common:${key}`, options);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
146
160
|
|
|
147
161
|
const index = {
|
|
148
162
|
__proto__: null,
|
|
149
163
|
changeLanguage: changeLanguage,
|
|
150
164
|
ensureI18nInitialized: ensureI18nInitialized,
|
|
151
165
|
format: format,
|
|
166
|
+
getTranslation: getTranslation,
|
|
152
167
|
i18n: i18n,
|
|
153
168
|
initI18n: initI18n
|
|
154
169
|
};
|
|
155
170
|
|
|
171
|
+
const PLAYWRIGHT_PROFILES_DIR = join(homedir(), ".ccjk", "playwright");
|
|
172
|
+
function createPlaywrightMcpConfig(options = {}) {
|
|
173
|
+
const {
|
|
174
|
+
profile = "default",
|
|
175
|
+
headless = false,
|
|
176
|
+
browser = "chromium",
|
|
177
|
+
userDataDir
|
|
178
|
+
} = options;
|
|
179
|
+
const resolvedUserDataDir = userDataDir || join(PLAYWRIGHT_PROFILES_DIR, profile);
|
|
180
|
+
const args = ["-y", "@playwright/mcp@latest"];
|
|
181
|
+
args.push("--browser", browser);
|
|
182
|
+
args.push("--user-data-dir", resolvedUserDataDir);
|
|
183
|
+
if (headless) {
|
|
184
|
+
args.push("--headless");
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
type: "stdio",
|
|
188
|
+
command: "npx",
|
|
189
|
+
args,
|
|
190
|
+
env: {}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
156
193
|
const MCP_SERVICE_CONFIGS = [
|
|
194
|
+
// Documentation and Search Services
|
|
157
195
|
{
|
|
158
196
|
id: "context7",
|
|
159
197
|
requiresApiKey: false,
|
|
@@ -178,6 +216,17 @@ const MCP_SERVICE_CONFIGS = [
|
|
|
178
216
|
}
|
|
179
217
|
}
|
|
180
218
|
},
|
|
219
|
+
{
|
|
220
|
+
id: "mcp-deepwiki",
|
|
221
|
+
requiresApiKey: false,
|
|
222
|
+
config: {
|
|
223
|
+
type: "stdio",
|
|
224
|
+
command: "npx",
|
|
225
|
+
args: ["-y", "mcp-deepwiki@latest"],
|
|
226
|
+
env: {}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
// Development Workflow Services
|
|
181
230
|
{
|
|
182
231
|
id: "spec-workflow",
|
|
183
232
|
requiresApiKey: false,
|
|
@@ -189,45 +238,80 @@ const MCP_SERVICE_CONFIGS = [
|
|
|
189
238
|
}
|
|
190
239
|
},
|
|
191
240
|
{
|
|
192
|
-
id: "
|
|
241
|
+
id: "serena",
|
|
193
242
|
requiresApiKey: false,
|
|
194
243
|
config: {
|
|
195
244
|
type: "stdio",
|
|
196
|
-
command: "
|
|
197
|
-
args: ["
|
|
245
|
+
command: "uvx",
|
|
246
|
+
args: ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "ide-assistant", "--enable-web-dashboard", "false"],
|
|
198
247
|
env: {}
|
|
199
248
|
}
|
|
200
249
|
},
|
|
250
|
+
// Browser and Automation Services
|
|
201
251
|
{
|
|
202
252
|
id: "Playwright",
|
|
203
253
|
requiresApiKey: false,
|
|
254
|
+
config: createPlaywrightMcpConfig()
|
|
255
|
+
// Uses default profile with chromium browser
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: "puppeteer",
|
|
259
|
+
requiresApiKey: false,
|
|
204
260
|
config: {
|
|
205
261
|
type: "stdio",
|
|
206
262
|
command: "npx",
|
|
207
|
-
args: ["-y", "@
|
|
263
|
+
args: ["-y", "@anthropic-ai/mcp-server-puppeteer@latest"],
|
|
208
264
|
env: {}
|
|
209
265
|
}
|
|
210
266
|
},
|
|
267
|
+
// Anthropic Official MCP Services
|
|
211
268
|
{
|
|
212
|
-
id: "
|
|
213
|
-
requiresApiKey:
|
|
214
|
-
apiKeyEnvVar: "EXA_API_KEY",
|
|
269
|
+
id: "filesystem",
|
|
270
|
+
requiresApiKey: false,
|
|
215
271
|
config: {
|
|
216
272
|
type: "stdio",
|
|
217
273
|
command: "npx",
|
|
218
|
-
args: ["-y", "
|
|
219
|
-
env: {
|
|
220
|
-
EXA_API_KEY: "YOUR_EXA_API_KEY"
|
|
221
|
-
}
|
|
274
|
+
args: ["-y", "@anthropic-ai/mcp-server-filesystem@latest", "."],
|
|
275
|
+
env: {}
|
|
222
276
|
}
|
|
223
277
|
},
|
|
224
278
|
{
|
|
225
|
-
id: "
|
|
279
|
+
id: "memory",
|
|
226
280
|
requiresApiKey: false,
|
|
227
281
|
config: {
|
|
228
282
|
type: "stdio",
|
|
229
|
-
command: "
|
|
230
|
-
args: ["
|
|
283
|
+
command: "npx",
|
|
284
|
+
args: ["-y", "@anthropic-ai/mcp-server-memory@latest"],
|
|
285
|
+
env: {}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: "sequential-thinking",
|
|
290
|
+
requiresApiKey: false,
|
|
291
|
+
config: {
|
|
292
|
+
type: "stdio",
|
|
293
|
+
command: "npx",
|
|
294
|
+
args: ["-y", "@anthropic-ai/mcp-server-sequential-thinking@latest"],
|
|
295
|
+
env: {}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "fetch",
|
|
300
|
+
requiresApiKey: false,
|
|
301
|
+
config: {
|
|
302
|
+
type: "stdio",
|
|
303
|
+
command: "npx",
|
|
304
|
+
args: ["-y", "@anthropic-ai/mcp-server-fetch@latest"],
|
|
305
|
+
env: {}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: "sqlite",
|
|
310
|
+
requiresApiKey: false,
|
|
311
|
+
config: {
|
|
312
|
+
type: "stdio",
|
|
313
|
+
command: "npx",
|
|
314
|
+
args: ["-y", "@anthropic-ai/mcp-server-sqlite@latest"],
|
|
231
315
|
env: {}
|
|
232
316
|
}
|
|
233
317
|
}
|
|
@@ -235,6 +319,7 @@ const MCP_SERVICE_CONFIGS = [
|
|
|
235
319
|
async function getMcpServices() {
|
|
236
320
|
ensureI18nInitialized();
|
|
237
321
|
const mcpServiceList = [
|
|
322
|
+
// Documentation and Search Services
|
|
238
323
|
{
|
|
239
324
|
id: "context7",
|
|
240
325
|
name: i18n.t("mcp:services.context7.name"),
|
|
@@ -245,31 +330,58 @@ async function getMcpServices() {
|
|
|
245
330
|
name: i18n.t("mcp:services.open-websearch.name"),
|
|
246
331
|
description: i18n.t("mcp:services.open-websearch.description")
|
|
247
332
|
},
|
|
333
|
+
{
|
|
334
|
+
id: "mcp-deepwiki",
|
|
335
|
+
name: i18n.t("mcp:services.mcp-deepwiki.name"),
|
|
336
|
+
description: i18n.t("mcp:services.mcp-deepwiki.description")
|
|
337
|
+
},
|
|
338
|
+
// Development Workflow Services
|
|
248
339
|
{
|
|
249
340
|
id: "spec-workflow",
|
|
250
341
|
name: i18n.t("mcp:services.spec-workflow.name"),
|
|
251
342
|
description: i18n.t("mcp:services.spec-workflow.description")
|
|
252
343
|
},
|
|
253
344
|
{
|
|
254
|
-
id: "
|
|
255
|
-
name: i18n.t("mcp:services.
|
|
256
|
-
description: i18n.t("mcp:services.
|
|
345
|
+
id: "serena",
|
|
346
|
+
name: i18n.t("mcp:services.serena.name"),
|
|
347
|
+
description: i18n.t("mcp:services.serena.description")
|
|
257
348
|
},
|
|
349
|
+
// Browser and Automation Services
|
|
258
350
|
{
|
|
259
351
|
id: "Playwright",
|
|
260
352
|
name: i18n.t("mcp:services.playwright.name"),
|
|
261
353
|
description: i18n.t("mcp:services.playwright.description")
|
|
262
354
|
},
|
|
263
355
|
{
|
|
264
|
-
id: "
|
|
265
|
-
name: i18n.t("mcp:services.
|
|
266
|
-
description: i18n.t("mcp:services.
|
|
267
|
-
apiKeyPrompt: i18n.t("mcp:services.exa.apiKeyPrompt")
|
|
356
|
+
id: "puppeteer",
|
|
357
|
+
name: i18n.t("mcp:services.puppeteer.name"),
|
|
358
|
+
description: i18n.t("mcp:services.puppeteer.description")
|
|
268
359
|
},
|
|
360
|
+
// Anthropic Official MCP Services
|
|
269
361
|
{
|
|
270
|
-
id: "
|
|
271
|
-
name: i18n.t("mcp:services.
|
|
272
|
-
description: i18n.t("mcp:services.
|
|
362
|
+
id: "filesystem",
|
|
363
|
+
name: i18n.t("mcp:services.filesystem.name"),
|
|
364
|
+
description: i18n.t("mcp:services.filesystem.description")
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: "memory",
|
|
368
|
+
name: i18n.t("mcp:services.memory.name"),
|
|
369
|
+
description: i18n.t("mcp:services.memory.description")
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: "sequential-thinking",
|
|
373
|
+
name: i18n.t("mcp:services.sequential-thinking.name"),
|
|
374
|
+
description: i18n.t("mcp:services.sequential-thinking.description")
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
id: "fetch",
|
|
378
|
+
name: i18n.t("mcp:services.fetch.name"),
|
|
379
|
+
description: i18n.t("mcp:services.fetch.description")
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
id: "sqlite",
|
|
383
|
+
name: i18n.t("mcp:services.sqlite.name"),
|
|
384
|
+
description: i18n.t("mcp:services.sqlite.description")
|
|
273
385
|
}
|
|
274
386
|
];
|
|
275
387
|
return MCP_SERVICE_CONFIGS.map((config) => {
|
|
@@ -281,17 +393,16 @@ async function getMcpServices() {
|
|
|
281
393
|
requiresApiKey: config.requiresApiKey,
|
|
282
394
|
config: config.config
|
|
283
395
|
};
|
|
284
|
-
if (config.requiresApiKey && serviceInfo?.apiKeyPrompt) {
|
|
285
|
-
if (serviceInfo.apiKeyPrompt !== `mcp.services.${config.id}.apiKeyPrompt`) {
|
|
286
|
-
service.apiKeyPrompt = serviceInfo.apiKeyPrompt;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
396
|
if (config.apiKeyEnvVar) {
|
|
290
397
|
service.apiKeyEnvVar = config.apiKeyEnvVar;
|
|
291
398
|
}
|
|
292
399
|
return service;
|
|
293
400
|
});
|
|
294
401
|
}
|
|
402
|
+
async function getMcpService(id) {
|
|
403
|
+
const services = await getMcpServices();
|
|
404
|
+
return services.find((service) => service.id === id);
|
|
405
|
+
}
|
|
295
406
|
|
|
296
407
|
const WORKFLOW_CONFIG_BASE = [
|
|
297
408
|
{
|
|
@@ -448,6 +559,14 @@ const CCJK_CONFIG_FILE = join(CCJK_CONFIG_DIR, "config.toml");
|
|
|
448
559
|
const CCJK_PLUGINS_DIR = join(CCJK_CONFIG_DIR, "plugins");
|
|
449
560
|
const CCJK_SKILLS_DIR = join(CCJK_CONFIG_DIR, "skills");
|
|
450
561
|
const CCJK_GROUPS_DIR = join(CCJK_CONFIG_DIR, "groups");
|
|
562
|
+
const CCJK_CLOUD_PLUGINS_DIR = join(CCJK_CONFIG_DIR, "cloud-plugins");
|
|
563
|
+
const CCJK_CLOUD_PLUGINS_CACHE_DIR = join(CCJK_CLOUD_PLUGINS_DIR, "cache");
|
|
564
|
+
const CCJK_CLOUD_PLUGINS_CACHE_FILE = join(CCJK_CLOUD_PLUGINS_CACHE_DIR, "plugins.json");
|
|
565
|
+
const CCJK_CLOUD_PLUGINS_INSTALLED_DIR = join(CCJK_CLOUD_PLUGINS_DIR, "installed");
|
|
566
|
+
const CCJK_CLOUD_API_URL = "https://api.ccjk.dev/v1";
|
|
567
|
+
const CCJK_CLOUD_PLUGINS_API = `${CCJK_CLOUD_API_URL}/plugins`;
|
|
568
|
+
const CLOUD_PLUGINS_CACHE_TTL = 24 * 60 * 60 * 1e3;
|
|
569
|
+
const CLOUD_PLUGINS_MAX_CACHE_SIZE = 1e3;
|
|
451
570
|
const LEGACY_ZCF_CONFIG_DIR = join(homedir(), ".ufomiao", "zcf");
|
|
452
571
|
const LEGACY_ZCF_CONFIG_FILE = join(LEGACY_ZCF_CONFIG_DIR, "config.toml");
|
|
453
572
|
const LEGACY_ZCF_CONFIG_FILES = [
|
|
@@ -570,6 +689,12 @@ const constants = {
|
|
|
570
689
|
AI_OUTPUT_LANGUAGES: AI_OUTPUT_LANGUAGES,
|
|
571
690
|
API_DEFAULT_URL: API_DEFAULT_URL,
|
|
572
691
|
API_ENV_KEY: API_ENV_KEY,
|
|
692
|
+
CCJK_CLOUD_API_URL: CCJK_CLOUD_API_URL,
|
|
693
|
+
CCJK_CLOUD_PLUGINS_API: CCJK_CLOUD_PLUGINS_API,
|
|
694
|
+
CCJK_CLOUD_PLUGINS_CACHE_DIR: CCJK_CLOUD_PLUGINS_CACHE_DIR,
|
|
695
|
+
CCJK_CLOUD_PLUGINS_CACHE_FILE: CCJK_CLOUD_PLUGINS_CACHE_FILE,
|
|
696
|
+
CCJK_CLOUD_PLUGINS_DIR: CCJK_CLOUD_PLUGINS_DIR,
|
|
697
|
+
CCJK_CLOUD_PLUGINS_INSTALLED_DIR: CCJK_CLOUD_PLUGINS_INSTALLED_DIR,
|
|
573
698
|
CCJK_CONFIG_DIR: CCJK_CONFIG_DIR,
|
|
574
699
|
CCJK_CONFIG_FILE: CCJK_CONFIG_FILE,
|
|
575
700
|
CCJK_GROUPS_DIR: CCJK_GROUPS_DIR,
|
|
@@ -580,6 +705,8 @@ const constants = {
|
|
|
580
705
|
CLAUDE_VSC_CONFIG_FILE: CLAUDE_VSC_CONFIG_FILE,
|
|
581
706
|
CLINE_CONFIG_FILE: CLINE_CONFIG_FILE,
|
|
582
707
|
CLINE_DIR: CLINE_DIR,
|
|
708
|
+
CLOUD_PLUGINS_CACHE_TTL: CLOUD_PLUGINS_CACHE_TTL,
|
|
709
|
+
CLOUD_PLUGINS_MAX_CACHE_SIZE: CLOUD_PLUGINS_MAX_CACHE_SIZE,
|
|
583
710
|
CODEX_AGENTS_FILE: CODEX_AGENTS_FILE,
|
|
584
711
|
CODEX_AUTH_FILE: CODEX_AUTH_FILE,
|
|
585
712
|
CODEX_CONFIG_FILE: CODEX_CONFIG_FILE,
|
|
@@ -727,16 +854,16 @@ function getPlatform() {
|
|
|
727
854
|
return "linux";
|
|
728
855
|
}
|
|
729
856
|
function isTermux() {
|
|
730
|
-
return !!(process
|
|
857
|
+
return !!(process.env.PREFIX && process.env.PREFIX.includes("com.termux")) || !!process.env.TERMUX_VERSION || nodeFs.existsSync("/data/data/com.termux/files/usr");
|
|
731
858
|
}
|
|
732
859
|
function getTermuxPrefix() {
|
|
733
|
-
return process
|
|
860
|
+
return process.env.PREFIX || "/data/data/com.termux/files/usr";
|
|
734
861
|
}
|
|
735
862
|
function isWindows() {
|
|
736
863
|
return getPlatform() === "windows";
|
|
737
864
|
}
|
|
738
865
|
function isWSL() {
|
|
739
|
-
if (process
|
|
866
|
+
if (process.env.WSL_DISTRO_NAME) {
|
|
740
867
|
return true;
|
|
741
868
|
}
|
|
742
869
|
if (nodeFs.existsSync("/proc/version")) {
|
|
@@ -754,8 +881,8 @@ function isWSL() {
|
|
|
754
881
|
return false;
|
|
755
882
|
}
|
|
756
883
|
function getWSLDistro() {
|
|
757
|
-
if (process
|
|
758
|
-
return process
|
|
884
|
+
if (process.env.WSL_DISTRO_NAME) {
|
|
885
|
+
return process.env.WSL_DISTRO_NAME;
|
|
759
886
|
}
|
|
760
887
|
if (nodeFs.existsSync("/etc/os-release")) {
|
|
761
888
|
try {
|
|
@@ -798,7 +925,7 @@ function normalizeTomlPath(str) {
|
|
|
798
925
|
function getSystemRoot() {
|
|
799
926
|
if (!isWindows())
|
|
800
927
|
return null;
|
|
801
|
-
const env = process
|
|
928
|
+
const env = process.env;
|
|
802
929
|
let systemRoot = "C:\\Windows";
|
|
803
930
|
if (Object.prototype.hasOwnProperty.call(env, "SYSTEMROOT") && env.SYSTEMROOT)
|
|
804
931
|
systemRoot = env.SYSTEMROOT;
|
|
@@ -816,7 +943,7 @@ function shouldUseSudoForGlobalInstall() {
|
|
|
816
943
|
if (isPathInsideHome(npmPrefix) || canWriteToPath(npmPrefix))
|
|
817
944
|
return false;
|
|
818
945
|
}
|
|
819
|
-
const getuid = process
|
|
946
|
+
const getuid = process.getuid;
|
|
820
947
|
if (typeof getuid !== "function")
|
|
821
948
|
return false;
|
|
822
949
|
try {
|
|
@@ -844,7 +971,7 @@ function normalizePath(path) {
|
|
|
844
971
|
return normalizeTomlPath(path).replace(/\/+$/, "");
|
|
845
972
|
}
|
|
846
973
|
function isPathInsideHome(path) {
|
|
847
|
-
const home = process
|
|
974
|
+
const home = process.env.HOME;
|
|
848
975
|
if (!home)
|
|
849
976
|
return false;
|
|
850
977
|
const normalizedHome = normalizePath(home);
|
|
@@ -860,11 +987,11 @@ function canWriteToPath(path) {
|
|
|
860
987
|
}
|
|
861
988
|
}
|
|
862
989
|
function getGlobalNpmPrefix() {
|
|
863
|
-
const env = process
|
|
990
|
+
const env = process.env;
|
|
864
991
|
const envPrefix = env.npm_config_prefix || env.NPM_CONFIG_PREFIX || env.PREFIX;
|
|
865
992
|
if (envPrefix)
|
|
866
993
|
return envPrefix;
|
|
867
|
-
const execPath = process
|
|
994
|
+
const execPath = process.execPath;
|
|
868
995
|
if (execPath) {
|
|
869
996
|
const binDir = dirname(execPath);
|
|
870
997
|
return dirname(binDir);
|
|
@@ -898,7 +1025,7 @@ async function commandExists(command) {
|
|
|
898
1025
|
`/usr/local/bin/${command}`,
|
|
899
1026
|
`/usr/bin/${command}`,
|
|
900
1027
|
`/bin/${command}`,
|
|
901
|
-
`${process
|
|
1028
|
+
`${process.env.HOME}/.local/bin/${command}`
|
|
902
1029
|
];
|
|
903
1030
|
for (const path of commonPaths) {
|
|
904
1031
|
if (nodeFs.existsSync(path)) {
|
|
@@ -975,7 +1102,7 @@ async function findCommandPath(command) {
|
|
|
975
1102
|
`/usr/local/bin/${command}`,
|
|
976
1103
|
`/usr/bin/${command}`,
|
|
977
1104
|
`/bin/${command}`,
|
|
978
|
-
`${process
|
|
1105
|
+
`${process.env.HOME}/.local/bin/${command}`
|
|
979
1106
|
];
|
|
980
1107
|
for (const path of commonPaths) {
|
|
981
1108
|
if (nodeFs.existsSync(path)) {
|
|
@@ -1092,6 +1219,18 @@ function writeFile(path, content, encoding = "utf-8") {
|
|
|
1092
1219
|
);
|
|
1093
1220
|
}
|
|
1094
1221
|
}
|
|
1222
|
+
function readJsonFile(path) {
|
|
1223
|
+
try {
|
|
1224
|
+
const content = readFile(path, "utf-8");
|
|
1225
|
+
return JSON.parse(content);
|
|
1226
|
+
} catch (error) {
|
|
1227
|
+
throw new FileSystemError(
|
|
1228
|
+
`Failed to read JSON file: ${path}`,
|
|
1229
|
+
path,
|
|
1230
|
+
error
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1095
1234
|
function copyFile(src, dest) {
|
|
1096
1235
|
try {
|
|
1097
1236
|
ensureFileDir(dest);
|
|
@@ -1231,6 +1370,7 @@ const fsOperations = {
|
|
|
1231
1370
|
isExecutable: isExecutable,
|
|
1232
1371
|
readDir: readDir,
|
|
1233
1372
|
readFile: readFile,
|
|
1373
|
+
readJsonFile: readJsonFile,
|
|
1234
1374
|
remove: remove,
|
|
1235
1375
|
removeFile: removeFile,
|
|
1236
1376
|
writeFile: writeFile
|
|
@@ -2442,7 +2582,7 @@ async function restartAndCheckCcrStatus() {
|
|
|
2442
2582
|
console.log(ansis.gray(stdout));
|
|
2443
2583
|
} catch (error) {
|
|
2444
2584
|
console.error(ansis.red(`${i18n.t("ccr:ccrRestartFailed")}:`), error.message || error);
|
|
2445
|
-
if (process
|
|
2585
|
+
if (process.env.DEBUG) {
|
|
2446
2586
|
console.error("Full error:", error);
|
|
2447
2587
|
}
|
|
2448
2588
|
}
|
|
@@ -2726,8 +2866,8 @@ async function detectAllClaudeCodeInstallations() {
|
|
|
2726
2866
|
const npmGlobalPaths = [
|
|
2727
2867
|
"/usr/local/bin/claude",
|
|
2728
2868
|
"/usr/bin/claude",
|
|
2729
|
-
`${process
|
|
2730
|
-
`${process
|
|
2869
|
+
`${process.env.HOME}/.npm-global/bin/claude`,
|
|
2870
|
+
`${process.env.HOME}/.local/bin/claude`
|
|
2731
2871
|
];
|
|
2732
2872
|
for (const path of npmGlobalPaths) {
|
|
2733
2873
|
if (nodeFs.existsSync(path)) {
|
|
@@ -3333,7 +3473,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
3333
3473
|
});
|
|
3334
3474
|
if (!lang) {
|
|
3335
3475
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
3336
|
-
process
|
|
3476
|
+
process.exit(0);
|
|
3337
3477
|
}
|
|
3338
3478
|
const aiOutputLang = lang;
|
|
3339
3479
|
if (aiOutputLang === "custom") {
|
|
@@ -3345,7 +3485,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
3345
3485
|
});
|
|
3346
3486
|
if (!customLang) {
|
|
3347
3487
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
3348
|
-
process
|
|
3488
|
+
process.exit(0);
|
|
3349
3489
|
}
|
|
3350
3490
|
return customLang;
|
|
3351
3491
|
}
|
|
@@ -3371,7 +3511,7 @@ async function selectScriptLanguage(currentLang) {
|
|
|
3371
3511
|
});
|
|
3372
3512
|
if (!lang) {
|
|
3373
3513
|
console.log(ansis.yellow(LANGUAGE_SELECTION_MESSAGES.operationCancelled));
|
|
3374
|
-
process
|
|
3514
|
+
process.exit(0);
|
|
3375
3515
|
}
|
|
3376
3516
|
const scriptLang = lang;
|
|
3377
3517
|
updateZcfConfig({
|
|
@@ -3425,7 +3565,7 @@ async function selectTemplateLanguage() {
|
|
|
3425
3565
|
});
|
|
3426
3566
|
if (!lang) {
|
|
3427
3567
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
3428
|
-
process
|
|
3568
|
+
process.exit(0);
|
|
3429
3569
|
}
|
|
3430
3570
|
return lang;
|
|
3431
3571
|
}
|
|
@@ -3508,7 +3648,7 @@ async function resolveSystemPromptStyle(availablePrompts, commandLineOption, sav
|
|
|
3508
3648
|
}]);
|
|
3509
3649
|
if (!systemPrompt) {
|
|
3510
3650
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
3511
|
-
process
|
|
3651
|
+
process.exit(0);
|
|
3512
3652
|
}
|
|
3513
3653
|
return systemPrompt;
|
|
3514
3654
|
}
|
|
@@ -3875,7 +4015,7 @@ function createBackupDirectory(timestamp) {
|
|
|
3875
4015
|
function backupCodexFiles() {
|
|
3876
4016
|
if (!exists(CODEX_DIR))
|
|
3877
4017
|
return null;
|
|
3878
|
-
if (process
|
|
4018
|
+
if (process.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP === "true" && cachedSkipPromptBackup)
|
|
3879
4019
|
return cachedSkipPromptBackup;
|
|
3880
4020
|
const timestamp = dayjs().format("YYYY-MM-DD_HH-mm-ss");
|
|
3881
4021
|
const backupDir = createBackupDirectory(timestamp);
|
|
@@ -3883,7 +4023,7 @@ function backupCodexFiles() {
|
|
|
3883
4023
|
return !path.includes("/backup");
|
|
3884
4024
|
};
|
|
3885
4025
|
copyDir(CODEX_DIR, backupDir, { filter });
|
|
3886
|
-
if (process
|
|
4026
|
+
if (process.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP === "true")
|
|
3887
4027
|
cachedSkipPromptBackup = backupDir;
|
|
3888
4028
|
return backupDir;
|
|
3889
4029
|
}
|
|
@@ -3904,7 +4044,7 @@ function backupCodexConfig() {
|
|
|
3904
4044
|
}
|
|
3905
4045
|
}
|
|
3906
4046
|
function backupCodexAgents() {
|
|
3907
|
-
if (process
|
|
4047
|
+
if (process.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP === "true" && cachedSkipPromptBackup)
|
|
3908
4048
|
return cachedSkipPromptBackup;
|
|
3909
4049
|
if (!exists(CODEX_AGENTS_FILE))
|
|
3910
4050
|
return null;
|
|
@@ -3919,7 +4059,7 @@ function backupCodexAgents() {
|
|
|
3919
4059
|
}
|
|
3920
4060
|
}
|
|
3921
4061
|
function backupCodexPrompts() {
|
|
3922
|
-
if (process
|
|
4062
|
+
if (process.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP === "true" && cachedSkipPromptBackup)
|
|
3923
4063
|
return cachedSkipPromptBackup;
|
|
3924
4064
|
if (!exists(CODEX_PROMPTS_DIR))
|
|
3925
4065
|
return null;
|
|
@@ -4161,7 +4301,7 @@ function parseCodexConfig(content) {
|
|
|
4161
4301
|
modelProviderCommented
|
|
4162
4302
|
};
|
|
4163
4303
|
} catch (error) {
|
|
4164
|
-
if (process
|
|
4304
|
+
if (process.env.NODE_ENV === "development" || process.env.DEBUG) {
|
|
4165
4305
|
console.warn("TOML parsing failed, falling back to basic parsing:", error);
|
|
4166
4306
|
}
|
|
4167
4307
|
const cleaned = content.replace(/^\s*#\s*---\s*model provider added by CCJK\s*---\s*$/gim, "").replace(/^\s*#\s*---\s*MCP servers added by CCJK\s*---\s*$/gim, "").replace(/^\[model_providers\.[^\]]+\][\s\S]*?(?=^\[|$)/gim, "").replace(/^\[mcp_servers\.[^\]]+\][\s\S]*?(?=^\[|$)/gim, "").replace(/^\s*(?:#\s*)?model_provider\s*=.*$/gim, "").replace(/^\s*model\s*=.*$/gim, "").replace(/\n{3,}/g, "\n\n");
|
|
@@ -5852,7 +5992,7 @@ function handleExitPromptError(error) {
|
|
|
5852
5992
|
console.log(ansis.cyan(`
|
|
5853
5993
|
${i18n.t("common:goodbye")}
|
|
5854
5994
|
`));
|
|
5855
|
-
process
|
|
5995
|
+
process.exit(0);
|
|
5856
5996
|
}
|
|
5857
5997
|
return false;
|
|
5858
5998
|
}
|
|
@@ -5862,7 +6002,7 @@ function handleGeneralError(error) {
|
|
|
5862
6002
|
if (error instanceof Error) {
|
|
5863
6003
|
console.error(ansis.gray(`${i18n.t("errors:stackTrace")}: ${error.stack}`));
|
|
5864
6004
|
}
|
|
5865
|
-
process
|
|
6005
|
+
process.exit(1);
|
|
5866
6006
|
}
|
|
5867
6007
|
|
|
5868
6008
|
async function isClaudeCodeInstalled() {
|
|
@@ -7297,7 +7437,7 @@ async function init(options = {}) {
|
|
|
7297
7437
|
});
|
|
7298
7438
|
if (!apiChoice) {
|
|
7299
7439
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
7300
|
-
process
|
|
7440
|
+
process.exit(0);
|
|
7301
7441
|
}
|
|
7302
7442
|
return await configureApiCompletely(apiChoice);
|
|
7303
7443
|
}
|
|
@@ -7334,7 +7474,7 @@ async function init(options = {}) {
|
|
|
7334
7474
|
}
|
|
7335
7475
|
if (codeToolType === "codex") {
|
|
7336
7476
|
if (options.skipPrompt)
|
|
7337
|
-
process
|
|
7477
|
+
process.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP = "true";
|
|
7338
7478
|
const hasApiConfigs = Boolean(options.apiConfigs || options.apiConfigsFile);
|
|
7339
7479
|
const apiMode = hasApiConfigs ? "skip" : options.apiType === "auth_token" ? "official" : options.apiType === "api_key" ? "custom" : options.apiType === "skip" ? "skip" : options.skipPrompt ? "skip" : void 0;
|
|
7340
7480
|
const customApiConfig = !hasApiConfigs && options.apiType === "api_key" && options.apiKey ? {
|
|
@@ -7447,7 +7587,7 @@ async function init(options = {}) {
|
|
|
7447
7587
|
});
|
|
7448
7588
|
if (!userAction) {
|
|
7449
7589
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
7450
|
-
process
|
|
7590
|
+
process.exit(0);
|
|
7451
7591
|
}
|
|
7452
7592
|
action = userAction;
|
|
7453
7593
|
if (action === "skip") {
|
|
@@ -7557,7 +7697,7 @@ async function init(options = {}) {
|
|
|
7557
7697
|
break;
|
|
7558
7698
|
default:
|
|
7559
7699
|
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
7560
|
-
process
|
|
7700
|
+
process.exit(0);
|
|
7561
7701
|
}
|
|
7562
7702
|
}
|
|
7563
7703
|
}
|
|
@@ -7648,7 +7788,7 @@ async function init(options = {}) {
|
|
|
7648
7788
|
} else {
|
|
7649
7789
|
selectedServices = await selectMcpServices();
|
|
7650
7790
|
if (selectedServices === void 0) {
|
|
7651
|
-
process
|
|
7791
|
+
process.exit(0);
|
|
7652
7792
|
}
|
|
7653
7793
|
}
|
|
7654
7794
|
if (selectedServices.length > 0) {
|
|
@@ -7748,20 +7888,20 @@ async function init(options = {}) {
|
|
|
7748
7888
|
});
|
|
7749
7889
|
console.log("");
|
|
7750
7890
|
console.log(ansis.bold.green("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
7751
|
-
console.log(ansis.bold.green("\u2551") + ansis.bold.white(` ${i18n.t("configuration:setupCompleteTitle")}
|
|
7891
|
+
console.log(ansis.bold.green("\u2551") + ansis.bold.white(padToDisplayWidth(` ${i18n.t("configuration:setupCompleteTitle")}`, 62)) + ansis.bold.green("\u2551"));
|
|
7752
7892
|
console.log(ansis.bold.green("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563"));
|
|
7753
7893
|
console.log(`${ansis.bold.green("\u2551")} ${ansis.bold.green("\u2551")}`);
|
|
7754
|
-
console.log(ansis.bold.green("\u2551") + ansis.cyan(` ${i18n.t("configuration:nextSteps")}
|
|
7894
|
+
console.log(ansis.bold.green("\u2551") + ansis.cyan(padToDisplayWidth(` ${i18n.t("configuration:nextSteps")}`, 62)) + ansis.bold.green("\u2551"));
|
|
7755
7895
|
console.log(`${ansis.bold.green("\u2551")} ${ansis.bold.green("\u2551")}`);
|
|
7756
|
-
console.log(ansis.bold.green("\u2551") + ` ${i18n.t("configuration:guidanceStep1")}
|
|
7757
|
-
console.log(ansis.bold.green("\u2551") + ansis.dim(` ${i18n.t("configuration:guidanceStep1Detail")}
|
|
7758
|
-
console.log(ansis.bold.green("\u2551") + ansis.dim(` ${i18n.t("configuration:guidanceStep1Detail2")}
|
|
7896
|
+
console.log(ansis.bold.green("\u2551") + padToDisplayWidth(` ${i18n.t("configuration:guidanceStep1")}`, 62) + ansis.bold.green("\u2551"));
|
|
7897
|
+
console.log(ansis.bold.green("\u2551") + ansis.dim(padToDisplayWidth(` ${i18n.t("configuration:guidanceStep1Detail")}`, 62)) + ansis.bold.green("\u2551"));
|
|
7898
|
+
console.log(ansis.bold.green("\u2551") + ansis.dim(padToDisplayWidth(` ${i18n.t("configuration:guidanceStep1Detail2")}`, 62)) + ansis.bold.green("\u2551"));
|
|
7759
7899
|
console.log(`${ansis.bold.green("\u2551")} ${ansis.bold.green("\u2551")}`);
|
|
7760
|
-
console.log(ansis.bold.green("\u2551") + ` ${i18n.t("configuration:guidanceStep2")}
|
|
7761
|
-
console.log(ansis.bold.green("\u2551") + ansis.cyan(` ${i18n.t("configuration:guidanceStep2Example")}
|
|
7900
|
+
console.log(ansis.bold.green("\u2551") + padToDisplayWidth(` ${i18n.t("configuration:guidanceStep2")}`, 62) + ansis.bold.green("\u2551"));
|
|
7901
|
+
console.log(ansis.bold.green("\u2551") + ansis.cyan(padToDisplayWidth(` ${i18n.t("configuration:guidanceStep2Example")}`, 62)) + ansis.bold.green("\u2551"));
|
|
7762
7902
|
console.log(`${ansis.bold.green("\u2551")} ${ansis.bold.green("\u2551")}`);
|
|
7763
|
-
console.log(ansis.bold.green("\u2551") + ` ${i18n.t("configuration:guidanceStep3")}
|
|
7764
|
-
console.log(ansis.bold.green("\u2551") + ` ${i18n.t("configuration:guidanceStep4")}
|
|
7903
|
+
console.log(ansis.bold.green("\u2551") + padToDisplayWidth(` ${i18n.t("configuration:guidanceStep3")} `, 44) + ansis.yellow(padToDisplayWidth(i18n.t("configuration:guidanceStep3Command"), 18)) + ansis.bold.green("\u2551"));
|
|
7904
|
+
console.log(ansis.bold.green("\u2551") + padToDisplayWidth(` ${i18n.t("configuration:guidanceStep4")} `, 44) + ansis.yellow(padToDisplayWidth(i18n.t("configuration:guidanceStep4Command"), 18)) + ansis.bold.green("\u2551"));
|
|
7765
7905
|
console.log(`${ansis.bold.green("\u2551")} ${ansis.bold.green("\u2551")}`);
|
|
7766
7906
|
console.log(ansis.bold.green("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
7767
7907
|
console.log("");
|
|
@@ -8333,14 +8473,12 @@ function readSettings() {
|
|
|
8333
8473
|
return {};
|
|
8334
8474
|
}
|
|
8335
8475
|
try {
|
|
8336
|
-
const { readFileSync } = require("node:fs");
|
|
8337
8476
|
return JSON.parse(readFileSync(SETTINGS_FILE, "utf-8"));
|
|
8338
8477
|
} catch {
|
|
8339
8478
|
return {};
|
|
8340
8479
|
}
|
|
8341
8480
|
}
|
|
8342
8481
|
function writeSettings(settings) {
|
|
8343
|
-
const { writeFileSync, mkdirSync } = require("node:fs");
|
|
8344
8482
|
if (!existsSync(CLAUDE_DIR)) {
|
|
8345
8483
|
mkdirSync(CLAUDE_DIR, { recursive: true });
|
|
8346
8484
|
}
|
|
@@ -8483,7 +8621,6 @@ function validateApiKey(apiKey, provider) {
|
|
|
8483
8621
|
return { valid: true };
|
|
8484
8622
|
}
|
|
8485
8623
|
function quickSetup(providerId, apiKey) {
|
|
8486
|
-
const { getPresetById } = require("./presets");
|
|
8487
8624
|
const preset = getPresetById(providerId);
|
|
8488
8625
|
if (!preset) {
|
|
8489
8626
|
return {
|
|
@@ -9177,22 +9314,26 @@ function getToolDir(tool) {
|
|
|
9177
9314
|
async function isToolInstalled(tool) {
|
|
9178
9315
|
try {
|
|
9179
9316
|
switch (tool) {
|
|
9180
|
-
case "claude-code":
|
|
9317
|
+
case "claude-code": {
|
|
9181
9318
|
const ccResult = await exec("claude", ["--version"]);
|
|
9182
9319
|
return ccResult.exitCode === 0;
|
|
9183
|
-
|
|
9320
|
+
}
|
|
9321
|
+
case "codex": {
|
|
9184
9322
|
const cxResult = await exec("codex", ["--version"]);
|
|
9185
9323
|
return cxResult.exitCode === 0;
|
|
9186
|
-
|
|
9324
|
+
}
|
|
9325
|
+
case "aider": {
|
|
9187
9326
|
const adResult = await exec("aider", ["--version"]);
|
|
9188
9327
|
return adResult.exitCode === 0;
|
|
9328
|
+
}
|
|
9189
9329
|
case "continue":
|
|
9190
9330
|
return existsSync(CONTINUE_DIR);
|
|
9191
9331
|
case "cline":
|
|
9192
9332
|
return existsSync(CLINE_DIR);
|
|
9193
|
-
case "cursor":
|
|
9333
|
+
case "cursor": {
|
|
9194
9334
|
const cuResult = await exec("cursor", ["--version"]);
|
|
9195
9335
|
return cuResult.exitCode === 0;
|
|
9336
|
+
}
|
|
9196
9337
|
default:
|
|
9197
9338
|
return false;
|
|
9198
9339
|
}
|
|
@@ -9529,8 +9670,7 @@ function removeRedundantConfigs(configs, keepPath = SETTINGS_FILE$1) {
|
|
|
9529
9670
|
const bakPath = `${config.path}.bak`;
|
|
9530
9671
|
if (existsSync(config.path)) {
|
|
9531
9672
|
copyFileSync(config.path, bakPath);
|
|
9532
|
-
|
|
9533
|
-
fs.unlinkSync(config.path);
|
|
9673
|
+
unlinkSync(config.path);
|
|
9534
9674
|
removed.push(config.path);
|
|
9535
9675
|
}
|
|
9536
9676
|
} catch {
|
|
@@ -10023,7 +10163,7 @@ function scanAgents(projectDir) {
|
|
|
10023
10163
|
for (const dir of agentDirs) {
|
|
10024
10164
|
if (existsSync(dir)) {
|
|
10025
10165
|
try {
|
|
10026
|
-
const files =
|
|
10166
|
+
const files = readdirSync(dir);
|
|
10027
10167
|
for (const file of files) {
|
|
10028
10168
|
if (file.endsWith(".md")) {
|
|
10029
10169
|
const filePath = join(dir, file);
|
|
@@ -10050,7 +10190,7 @@ function scanSkills(projectDir) {
|
|
|
10050
10190
|
for (const dir of skillDirs) {
|
|
10051
10191
|
if (existsSync(dir)) {
|
|
10052
10192
|
try {
|
|
10053
|
-
const files =
|
|
10193
|
+
const files = readdirSync(dir);
|
|
10054
10194
|
for (const file of files) {
|
|
10055
10195
|
if (file.endsWith(".md")) {
|
|
10056
10196
|
const filePath = join(dir, file);
|
|
@@ -10393,4 +10533,4 @@ async function openSettingsJson() {
|
|
|
10393
10533
|
}
|
|
10394
10534
|
}
|
|
10395
10535
|
|
|
10396
|
-
export {
|
|
10536
|
+
export { LEGACY_ZCF_CONFIG_FILE as $, AIDER_DIR as A, SETTINGS_FILE$1 as B, CCJK_PLUGINS_DIR as C, CLAUDE_MD_FILE as D, ClAUDE_CONFIG_FILE as E, CLAUDE_VSC_CONFIG_FILE as F, CODEX_DIR as G, CODEX_CONFIG_FILE as H, CODEX_AUTH_FILE as I, CODEX_AGENTS_FILE as J, CODEX_PROMPTS_DIR as K, CLINE_DIR as L, CLINE_CONFIG_FILE as M, CURSOR_DIR as N, CURSOR_CONFIG_FILE as O, CCJK_CONFIG_DIR as P, CCJK_CONFIG_FILE as Q, CCJK_CLOUD_PLUGINS_DIR as R, STATUS as S, CCJK_CLOUD_PLUGINS_CACHE_DIR as T, CCJK_CLOUD_PLUGINS_CACHE_FILE as U, CCJK_CLOUD_PLUGINS_INSTALLED_DIR as V, CCJK_CLOUD_API_URL as W, CCJK_CLOUD_PLUGINS_API as X, CLOUD_PLUGINS_CACHE_TTL as Y, CLOUD_PLUGINS_MAX_CACHE_SIZE as Z, LEGACY_ZCF_CONFIG_DIR as _, CCJK_SKILLS_DIR as a, parseCodexConfig as a$, LEGACY_ZCF_CONFIG_FILES as a0, ZCF_CONFIG_DIR as a1, ZCF_CONFIG_FILE as a2, CODE_TOOL_TYPES as a3, DEFAULT_CODE_TOOL_TYPE as a4, CODE_TOOL_BANNERS as a5, CODE_TOOL_ALIASES as a6, CODE_TOOL_INFO as a7, isCodeToolType as a8, API_DEFAULT_URL as a9, mergeMcpServers as aA, buildMcpServerConfig as aB, fixWindowsMcpConfig as aC, addCompletedOnboarding as aD, ensureApiKeyApproved as aE, removeApiKeyFromRejected as aF, manageApiKeyApproval as aG, setPrimaryApiKey as aH, backupCodexAgents as aI, backupCodexComplete as aJ, backupCodexConfig as aK, backupCodexFiles as aL, backupCodexPrompts as aM, checkCodexUpdate as aN, switchToOfficialLogin as aO, configureCodexApi as aP, createBackupDirectory as aQ, ensureEnvKeyMigration as aR, getBackupMessage as aS, getCodexVersion as aT, getCurrentCodexProvider as aU, installCodexCli as aV, isCodexInstalled$1 as aW, listCodexProviders as aX, migrateEnvKeyInContent as aY, migrateEnvKeyToTempEnvKey as aZ, needsEnvKeyMigration as a_, API_ENV_KEY as aa, resolveCodeToolType as ab, SUPPORTED_LANGS as ac, LANG_LABELS as ad, AI_OUTPUT_LANGUAGES as ae, getAiOutputLanguageLabel as af, detectPackageManager as ag, detectFrameworks as ah, detectBuildTools as ai, detectTestFrameworks as aj, detectCICDSystems as ak, detectLanguages as al, determineProjectType as am, detectProject as an, generateSuggestions as ao, getProjectSummary as ap, getDisplayWidth as aq, padToDisplayWidth as ar, displayBanner as as, displayBannerWithInfo as at, boxify as au, menuItem as av, getMcpConfigPath as aw, readMcpConfig as ax, writeMcpConfig as ay, backupMcpConfig as az, CCJK_GROUPS_DIR as b, createHomebrewSymlink as b$, readCodexConfig as b0, renderCodexConfig as b1, runCodexFullInit as b2, runCodexSystemPromptSelection as b3, runCodexUninstall as b4, runCodexUpdate as b5, runCodexWorkflowImport as b6, runCodexWorkflowImportWithLanguageSelection as b7, runCodexWorkflowSelection as b8, switchCodexProvider as b9, updateCustomModel as bA, updateDefaultModel as bB, mergeSettingsFile as bC, getExistingModelConfig as bD, getExistingApiConfig as bE, applyAiLanguageDirective as bF, switchToOfficialLogin$1 as bG, promptApiConfigurationAction as bH, compareConfigs as bI, consolidateConfigs as bJ, writeConsolidatedConfig as bK, removeRedundantConfigs as bL, displayConfigScan as bM, isClaudeCodeInstalled as bN, installClaudeCode as bO, isCodexInstalled as bP, installCodex as bQ, isLocalClaudeCodeInstalled as bR, getInstallationStatus as bS, removeLocalClaudeCode as bT, uninstallCodeTool as bU, setInstallMethod as bV, detectInstalledVersion as bW, selectInstallMethod as bX, executeInstallMethod as bY, handleInstallFailure as bZ, verifyInstallation as b_, switchToProvider as ba, writeAuthFile as bb, writeCodexConfig as bc, detectConfigManagementMode as bd, shouldShowManagementMode as be, getAvailableManagementActions as bf, configureCodexMcp as bg, applyCodexPlatformCommand as bh, getToolConfigPath as bi, getToolDir as bj, isToolInstalled as bk, getToolVersion as bl, getToolStatus as bm, getAllToolsStatus as bn, getInstalledTools as bo, installTool as bp, getToolInfo as bq, getAllToolsInfo as br, getToolsByCategory as bs, formatToolStatus as bt, getRecommendedTools as bu, ensureClaudeDir as bv, backupExistingConfig as bw, copyConfigFiles as bx, configureApi as by, mergeConfigs as bz, AIDER_CONFIG_FILE as c, checkSuperpowersInstalled as c$, displayVerificationResult as c0, loadKnowledgeBase as c1, saveKnowledgeBase as c2, runOnboarding as c3, quickSync as c4, getProjectKnowledge as c5, exportProjectKnowledge as c6, PERMISSION_TEMPLATES as c7, readPermissions as c8, writePermissions as c9, configureCcrFeature as cA, promptBoolean as cB, handleExitPromptError as cC, handleGeneralError as cD, COMETIX_COMMAND_NAME as cE, COMETIX_COMMANDS as cF, installCometixLine as cG, addNumbersToChoices as cH, checkAndUpdateTools as cI, resolveCodeType as cJ, readZcfConfig as cK, ensureDir as cL, writeFile as cM, exists as cN, readJsonFile as cO, getMcpService as cP, isWindows as cQ, getSystemRoot as cR, MCP_SERVICE_CONFIGS as cS, readJsonConfig as cT, writeJsonConfig as cU, moveToTrash as cV, updateZcfConfig as cW, resolveAiOutputLanguage as cX, updatePromptOnly as cY, selectAndInstallWorkflows as cZ, checkClaudeCodeVersionAndPrompt as c_, applyTemplate as ca, trustDirectory as cb, untrustDirectory as cc, isPermissionAllowed as cd, isDirectoryTrusted as ce, addAutoApprovePattern as cf, removeAutoApprovePattern as cg, resetPermissions as ch, exportPermissions as ci, importPermissions as cj, displayPermissions as ck, checkPluginVersions as cl, upgradeClaudeCode as cm, upgradeCcjk as cn, upgradePlugin as co, upgradeAllPlugins as cp, checkAllVersions as cq, upgradeAll as cr, testApiConnection as cs, quickSetup as ct, format as cu, getAllPresets as cv, ensureI18nInitialized as cw, readCcrConfig as cx, isCcrInstalled as cy, installCcr as cz, AIDER_ENV_FILE as d, getSuperpowersSkills as d0, updateSuperpowers as d1, uninstallSuperpowers as d2, installSuperpowers as d3, installSuperpowersViaGit as d4, readZcfConfigAsync as d5, initI18n as d6, selectScriptLanguage as d7, changeLanguage as d8, validateApiKey$1 as d9, readDefaultTomlConfig as da, createDefaultTomlConfig as db, writeTomlConfig as dc, clearModelEnv as dd, copyFile as de, getTranslation as df, configureOutputStyle as dg, selectMcpServices as dh, getMcpServices as di, setupCcrConfiguration as dj, modifyApiConfigPartially as dk, formatApiKeyDisplay as dl, index as dm, fsOperations as dn, jsonConfig as dp, claudeConfig as dq, config$1 as dr, config as ds, prompts as dt, codex as du, installer as dv, CONTINUE_DIR as e, CONTINUE_CONFIG_FILE as f, checkClaudeCodeVersion as g, checkCcjkVersion as h, i18n as i, detectAllConfigs as j, getCurrentTemplateId as k, COLORS as l, init as m, displayCurrentStatus as n, runConfigWizard as o, cleanupPermissions as p, mergeAndCleanPermissions as q, renderProgressBar as r, sectionDivider as s, commandExists as t, getPlatform as u, version as v, importRecommendedEnv as w, importRecommendedPermissions as x, openSettingsJson as y, CLAUDE_DIR$1 as z };
|