ccjk 2.4.4 → 2.6.0
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/dist/chunks/api-providers.mjs +73 -1
- package/dist/chunks/ccjk-config.mjs +13 -77
- package/dist/chunks/ccr.mjs +9 -4
- package/dist/chunks/check-updates.mjs +4 -2
- package/dist/chunks/claude-code-config-manager.mjs +9 -15
- package/dist/chunks/claude-code-incremental-manager.mjs +5 -8
- package/dist/chunks/codex.mjs +10 -569
- package/dist/chunks/config-switch.mjs +7 -5
- package/dist/chunks/config.mjs +573 -0
- package/dist/chunks/config2.mjs +454 -0
- package/dist/chunks/doctor.mjs +89 -1
- package/dist/chunks/features.mjs +13 -10
- package/dist/chunks/index.mjs +10 -1164
- package/dist/chunks/index2.mjs +10 -2
- package/dist/chunks/init.mjs +14 -11
- package/dist/chunks/json-config.mjs +59 -0
- package/dist/chunks/mcp-server.mjs +776 -0
- package/dist/chunks/mcp.mjs +10 -8
- package/dist/chunks/menu.mjs +5 -5
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permissions.mjs +428 -0
- package/dist/chunks/prompts.mjs +2 -1
- package/dist/chunks/providers.mjs +261 -0
- package/dist/chunks/session.mjs +484 -41
- package/dist/chunks/skills.mjs +553 -0
- package/dist/chunks/stats.mjs +411 -0
- package/dist/chunks/uninstall.mjs +4 -3
- package/dist/chunks/update.mjs +6 -3
- package/dist/chunks/workflows2.mjs +140 -0
- package/dist/cli.mjs +290 -10
- package/dist/i18n/locales/en/hooks.json +47 -0
- package/dist/i18n/locales/en/mcp.json +55 -0
- package/dist/i18n/locales/en/permissions.json +43 -0
- package/dist/i18n/locales/en/registry.json +54 -0
- package/dist/i18n/locales/en/sandbox.json +44 -0
- package/dist/i18n/locales/en/skills.json +89 -129
- package/dist/i18n/locales/en/stats.json +20 -0
- package/dist/i18n/locales/zh-CN/hooks.json +47 -0
- package/dist/i18n/locales/zh-CN/mcp.json +55 -0
- package/dist/i18n/locales/zh-CN/permissions.json +43 -0
- package/dist/i18n/locales/zh-CN/registry.json +54 -0
- package/dist/i18n/locales/zh-CN/sandbox.json +44 -0
- package/dist/i18n/locales/zh-CN/skills.json +88 -128
- package/dist/i18n/locales/zh-CN/stats.json +20 -0
- package/dist/index.mjs +12 -8
- package/dist/shared/ccjk.B-lZxV2u.mjs +1162 -0
- package/dist/shared/{ccjk.CURU8gbR.mjs → ccjk.CUdzQluX.mjs} +1 -1
- package/dist/shared/{ccjk.ByTIGCUC.mjs → ccjk.Dut3wyoP.mjs} +1 -1
- package/dist/shared/ccjk.J8YiPsOw.mjs +259 -0
- package/dist/shared/{ccjk.CGTmRqsu.mjs → ccjk.rLRHmcqD.mjs} +5 -134
- package/dist/shared/{ccjk.QbS8EAOd.mjs → ccjk.uVUeWAt8.mjs} +2 -1
- package/package.json +1 -1
- package/templates/common/skills/code-review.md +343 -0
- package/templates/common/skills/summarize.md +312 -0
- package/templates/common/skills/translate.md +202 -0
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { CCJK_CLOUD_API_URL } from './constants.mjs';
|
|
2
|
+
import 'node:os';
|
|
3
|
+
import 'pathe';
|
|
4
|
+
import './index2.mjs';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'node:process';
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'i18next';
|
|
9
|
+
import 'i18next-fs-backend';
|
|
10
|
+
|
|
1
11
|
const LOCAL_PROVIDER_PRESETS = [
|
|
2
12
|
{
|
|
3
13
|
id: "glm",
|
|
@@ -46,14 +56,76 @@ const LOCAL_PROVIDER_PRESETS = [
|
|
|
46
56
|
description: "Kimi (Moonshot AI)"
|
|
47
57
|
}
|
|
48
58
|
];
|
|
59
|
+
let cloudProvidersCache = null;
|
|
60
|
+
let cloudProvidersCacheTime = 0;
|
|
61
|
+
const CACHE_TTL = 5 * 60 * 1e3;
|
|
62
|
+
async function fetchCloudProviders(codeType) {
|
|
63
|
+
try {
|
|
64
|
+
const url = new URL(`${CCJK_CLOUD_API_URL}/providers`);
|
|
65
|
+
if (codeType) {
|
|
66
|
+
url.searchParams.set("codeType", codeType);
|
|
67
|
+
}
|
|
68
|
+
const response = await fetch(url.toString(), {
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: {
|
|
71
|
+
"Content-Type": "application/json"
|
|
72
|
+
},
|
|
73
|
+
signal: AbortSignal.timeout(5e3)
|
|
74
|
+
// 5 second timeout
|
|
75
|
+
});
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
const result = await response.json();
|
|
80
|
+
if (result.success && Array.isArray(result.data)) {
|
|
81
|
+
return result.data.map((p) => ({ ...p, isCloud: true }));
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
} catch {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function getApiProvidersAsync(codeToolType) {
|
|
89
|
+
const now = Date.now();
|
|
90
|
+
if (cloudProvidersCache && now - cloudProvidersCacheTime < CACHE_TTL) {
|
|
91
|
+
const providers = cloudProvidersCache;
|
|
92
|
+
if (codeToolType) {
|
|
93
|
+
return providers.filter((p) => p.supportedCodeTools.includes(codeToolType));
|
|
94
|
+
}
|
|
95
|
+
return providers;
|
|
96
|
+
}
|
|
97
|
+
const cloudProviders = await fetchCloudProviders(codeToolType);
|
|
98
|
+
if (cloudProviders.length > 0) {
|
|
99
|
+
cloudProvidersCache = cloudProviders;
|
|
100
|
+
cloudProvidersCacheTime = now;
|
|
101
|
+
return cloudProviders;
|
|
102
|
+
}
|
|
103
|
+
if (codeToolType) {
|
|
104
|
+
return LOCAL_PROVIDER_PRESETS.filter((p) => p.supportedCodeTools.includes(codeToolType));
|
|
105
|
+
}
|
|
106
|
+
return LOCAL_PROVIDER_PRESETS;
|
|
107
|
+
}
|
|
49
108
|
function getApiProviders(codeToolType) {
|
|
109
|
+
if (cloudProvidersCache) {
|
|
110
|
+
return cloudProvidersCache.filter((p) => p.supportedCodeTools.includes(codeToolType));
|
|
111
|
+
}
|
|
50
112
|
return LOCAL_PROVIDER_PRESETS.filter((p) => p.supportedCodeTools.includes(codeToolType));
|
|
51
113
|
}
|
|
52
114
|
function getProviderPreset(providerId) {
|
|
115
|
+
if (cloudProvidersCache) {
|
|
116
|
+
const cachedProvider = cloudProvidersCache.find((p) => p.id === providerId);
|
|
117
|
+
if (cachedProvider) {
|
|
118
|
+
return cachedProvider;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
53
121
|
return LOCAL_PROVIDER_PRESETS.find((p) => p.id === providerId);
|
|
54
122
|
}
|
|
55
123
|
function getValidProviderIds() {
|
|
124
|
+
if (cloudProvidersCache) {
|
|
125
|
+
return cloudProvidersCache.map((p) => p.id);
|
|
126
|
+
}
|
|
56
127
|
return LOCAL_PROVIDER_PRESETS.map((p) => p.id);
|
|
57
128
|
}
|
|
129
|
+
const getApiProviderPresets = getApiProvidersAsync;
|
|
58
130
|
|
|
59
|
-
export { LOCAL_PROVIDER_PRESETS, getApiProviders, getProviderPreset, getValidProviderIds };
|
|
131
|
+
export { LOCAL_PROVIDER_PRESETS, getApiProviderPresets, getApiProviders, getApiProvidersAsync, getProviderPreset, getValidProviderIds };
|
|
@@ -1,67 +1,18 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, renameSync, copyFileSync, rmSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { dirname } from 'pathe';
|
|
3
3
|
import { parse, stringify } from 'smol-toml';
|
|
4
4
|
import { DEFAULT_CODE_TOOL_TYPE, ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, ZCF_CONFIG_DIR, isCodeToolType, SUPPORTED_LANGS } from './constants.mjs';
|
|
5
|
-
import { exists, readFile,
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (validate && !validate(data)) {
|
|
17
|
-
console.log(`Invalid configuration: ${path}`);
|
|
18
|
-
return defaultValue;
|
|
19
|
-
}
|
|
20
|
-
if (sanitize) {
|
|
21
|
-
return sanitize(data);
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.error(`Failed to parse JSON: ${path}`, error);
|
|
26
|
-
return defaultValue;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function writeJsonConfig(path, data, options = {}) {
|
|
30
|
-
const { pretty = true, backup = false, backupDir, atomic = true } = options;
|
|
31
|
-
if (backup && exists(path)) {
|
|
32
|
-
backupJsonConfig(path, backupDir);
|
|
33
|
-
}
|
|
34
|
-
const content = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
|
|
35
|
-
if (atomic) {
|
|
36
|
-
writeFileAtomic(path, content);
|
|
37
|
-
} else {
|
|
38
|
-
writeFile(path, content);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function backupJsonConfig(path, backupDir) {
|
|
42
|
-
if (!exists(path)) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
const timestamp = dayjs().format("YYYY-MM-DD_HH-mm-ss");
|
|
46
|
-
const fileName = path.split("/").pop() || "config.json";
|
|
47
|
-
const baseDir = backupDir || join(path, "..", "backup");
|
|
48
|
-
const backupPath = join(baseDir, `${fileName}.backup_${timestamp}`);
|
|
49
|
-
try {
|
|
50
|
-
ensureDir(baseDir);
|
|
51
|
-
copyFile(path, backupPath);
|
|
52
|
-
return backupPath;
|
|
53
|
-
} catch (error) {
|
|
54
|
-
console.error("Failed to backup config", error);
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const jsonConfig = {
|
|
60
|
-
__proto__: null,
|
|
61
|
-
backupJsonConfig: backupJsonConfig,
|
|
62
|
-
readJsonConfig: readJsonConfig,
|
|
63
|
-
writeJsonConfig: writeJsonConfig
|
|
64
|
-
};
|
|
5
|
+
import { exists, readFile, ensureDir, writeFileAtomic } from './fs-operations.mjs';
|
|
6
|
+
import { readJsonConfig } from './json-config.mjs';
|
|
7
|
+
import 'node:os';
|
|
8
|
+
import './index2.mjs';
|
|
9
|
+
import 'node:process';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import 'i18next';
|
|
12
|
+
import 'i18next-fs-backend';
|
|
13
|
+
import 'node:crypto';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import 'dayjs';
|
|
65
16
|
|
|
66
17
|
function isSupportedLang(value) {
|
|
67
18
|
return SUPPORTED_LANGS.includes(value);
|
|
@@ -307,19 +258,4 @@ function readDefaultTomlConfig() {
|
|
|
307
258
|
return readTomlConfig(ZCF_CONFIG_FILE);
|
|
308
259
|
}
|
|
309
260
|
|
|
310
|
-
|
|
311
|
-
__proto__: null,
|
|
312
|
-
createDefaultTomlConfig: createDefaultTomlConfig,
|
|
313
|
-
migrateFromJsonConfig: migrateFromJsonConfig,
|
|
314
|
-
migrateZcfConfigIfNeeded: migrateZcfConfigIfNeeded,
|
|
315
|
-
readDefaultTomlConfig: readDefaultTomlConfig,
|
|
316
|
-
readTomlConfig: readTomlConfig,
|
|
317
|
-
readZcfConfig: readZcfConfig,
|
|
318
|
-
readZcfConfigAsync: readZcfConfigAsync,
|
|
319
|
-
updateTomlConfig: updateTomlConfig,
|
|
320
|
-
updateZcfConfig: updateZcfConfig,
|
|
321
|
-
writeTomlConfig: writeTomlConfig,
|
|
322
|
-
writeZcfConfig: writeZcfConfig
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
export { readZcfConfig as a, backupJsonConfig as b, readDefaultTomlConfig as c, updateTomlConfig as d, readZcfConfigAsync as e, createDefaultTomlConfig as f, writeTomlConfig as g, ccjkConfig as h, jsonConfig as j, readJsonConfig as r, updateZcfConfig as u, writeJsonConfig as w };
|
|
261
|
+
export { createDefaultTomlConfig, migrateFromJsonConfig, migrateZcfConfigIfNeeded, readDefaultTomlConfig, readTomlConfig, readZcfConfig, readZcfConfigAsync, updateTomlConfig, updateZcfConfig, writeTomlConfig, writeZcfConfig };
|
package/dist/chunks/ccr.mjs
CHANGED
|
@@ -18,25 +18,28 @@ import 'smol-toml';
|
|
|
18
18
|
import './fs-operations.mjs';
|
|
19
19
|
import 'node:crypto';
|
|
20
20
|
import 'node:fs/promises';
|
|
21
|
+
import './json-config.mjs';
|
|
21
22
|
import 'dayjs';
|
|
22
23
|
import './codex.mjs';
|
|
23
24
|
import 'ora';
|
|
24
25
|
import 'semver';
|
|
25
26
|
import 'tinyexec';
|
|
27
|
+
import './config.mjs';
|
|
26
28
|
import './platform.mjs';
|
|
27
29
|
import '../shared/ccjk.DhBeLRzf.mjs';
|
|
28
30
|
import 'inquirer-toggle';
|
|
29
31
|
import './prompts.mjs';
|
|
30
32
|
import 'node:child_process';
|
|
31
|
-
import '../shared/ccjk.
|
|
33
|
+
import '../shared/ccjk.CUdzQluX.mjs';
|
|
32
34
|
import './features.mjs';
|
|
33
35
|
import './init.mjs';
|
|
34
|
-
import '
|
|
36
|
+
import './workflows2.mjs';
|
|
35
37
|
import 'node:util';
|
|
36
38
|
import './auto-updater.mjs';
|
|
37
39
|
import './version-checker.mjs';
|
|
38
40
|
import 'node:path';
|
|
39
|
-
import '../shared/ccjk.
|
|
41
|
+
import '../shared/ccjk.rLRHmcqD.mjs';
|
|
42
|
+
import '../shared/ccjk.Dut3wyoP.mjs';
|
|
40
43
|
import '../shared/ccjk.RR9TS76h.mjs';
|
|
41
44
|
import 'node:stream';
|
|
42
45
|
import 'node:stream/promises';
|
|
@@ -48,7 +51,9 @@ import './check-updates.mjs';
|
|
|
48
51
|
import './config-switch.mjs';
|
|
49
52
|
import './claude-code-config-manager.mjs';
|
|
50
53
|
import './doctor.mjs';
|
|
51
|
-
import '
|
|
54
|
+
import './api-providers.mjs';
|
|
55
|
+
import '../shared/ccjk.J8YiPsOw.mjs';
|
|
56
|
+
import '../shared/ccjk.uVUeWAt8.mjs';
|
|
52
57
|
import './notification.mjs';
|
|
53
58
|
import 'node:buffer';
|
|
54
59
|
import '@iarna/toml';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
2
|
import ansis from 'ansis';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
4
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
4
|
+
import { r as resolveCodeType } from '../shared/ccjk.CUdzQluX.mjs';
|
|
5
5
|
import { checkAndUpdateTools } from './auto-updater.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { C as runCodexUpdate } from './codex.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:url';
|
|
9
9
|
import 'i18next';
|
|
@@ -16,6 +16,7 @@ import 'smol-toml';
|
|
|
16
16
|
import './fs-operations.mjs';
|
|
17
17
|
import 'node:crypto';
|
|
18
18
|
import 'node:fs/promises';
|
|
19
|
+
import './json-config.mjs';
|
|
19
20
|
import 'dayjs';
|
|
20
21
|
import 'ora';
|
|
21
22
|
import 'tinyexec';
|
|
@@ -28,6 +29,7 @@ import 'node:path';
|
|
|
28
29
|
import 'node:util';
|
|
29
30
|
import 'semver';
|
|
30
31
|
import 'inquirer';
|
|
32
|
+
import './config.mjs';
|
|
31
33
|
import './prompts.mjs';
|
|
32
34
|
import './package.mjs';
|
|
33
35
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { join } from 'pathe';
|
|
3
3
|
import { ZCF_CONFIG_FILE, ZCF_CONFIG_DIR, SETTINGS_FILE } from './constants.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { readDefaultTomlConfig, createDefaultTomlConfig, writeTomlConfig } from './ccjk-config.mjs';
|
|
5
|
+
import { B as clearModelEnv } from './config.mjs';
|
|
6
6
|
import { ensureDir, exists, copyFile } from './fs-operations.mjs';
|
|
7
|
+
import { readJsonConfig } from './json-config.mjs';
|
|
7
8
|
import 'node:os';
|
|
8
9
|
import './index2.mjs';
|
|
9
10
|
import 'node:fs';
|
|
@@ -12,19 +13,12 @@ import 'node:url';
|
|
|
12
13
|
import 'i18next';
|
|
13
14
|
import 'i18next-fs-backend';
|
|
14
15
|
import 'smol-toml';
|
|
16
|
+
import 'node:crypto';
|
|
17
|
+
import 'node:fs/promises';
|
|
15
18
|
import 'ansis';
|
|
16
19
|
import 'inquirer';
|
|
17
|
-
import 'ora';
|
|
18
|
-
import 'semver';
|
|
19
|
-
import 'tinyexec';
|
|
20
20
|
import './platform.mjs';
|
|
21
|
-
import '
|
|
22
|
-
import 'inquirer-toggle';
|
|
23
|
-
import './prompts.mjs';
|
|
24
|
-
import './package.mjs';
|
|
25
|
-
import 'node:crypto';
|
|
26
|
-
import 'node:fs/promises';
|
|
27
|
-
import 'node:child_process';
|
|
21
|
+
import 'tinyexec';
|
|
28
22
|
|
|
29
23
|
class ClaudeCodeConfigManager {
|
|
30
24
|
static CONFIG_FILE = ZCF_CONFIG_FILE;
|
|
@@ -195,11 +189,11 @@ class ClaudeCodeConfigManager {
|
|
|
195
189
|
ensureI18nInitialized();
|
|
196
190
|
try {
|
|
197
191
|
if (!profile) {
|
|
198
|
-
const { switchToOfficialLogin } = await import('./
|
|
192
|
+
const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.D; });
|
|
199
193
|
switchToOfficialLogin();
|
|
200
194
|
return;
|
|
201
195
|
}
|
|
202
|
-
const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./
|
|
196
|
+
const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./json-config.mjs');
|
|
203
197
|
const settings = readJsonConfig2(SETTINGS_FILE) || {};
|
|
204
198
|
if (!settings.env)
|
|
205
199
|
settings.env = {};
|
|
@@ -247,7 +241,7 @@ class ClaudeCodeConfigManager {
|
|
|
247
241
|
clearModelEnv(settings.env);
|
|
248
242
|
}
|
|
249
243
|
writeJsonConfig(SETTINGS_FILE, settings);
|
|
250
|
-
const { setPrimaryApiKey, addCompletedOnboarding } = await import('./
|
|
244
|
+
const { setPrimaryApiKey, addCompletedOnboarding } = await import('./config.mjs').then(function (n) { return n.C; });
|
|
251
245
|
setPrimaryApiKey();
|
|
252
246
|
addCompletedOnboarding();
|
|
253
247
|
if (shouldRestartCcr) {
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
4
4
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
5
5
|
import { a as addNumbersToChoices, p as promptBoolean } from '../shared/ccjk.DhBeLRzf.mjs';
|
|
6
|
-
import { v as validateApiKey } from '../shared/ccjk.
|
|
6
|
+
import { v as validateApiKey } from '../shared/ccjk.rLRHmcqD.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:process';
|
|
9
9
|
import 'node:url';
|
|
@@ -18,15 +18,12 @@ import 'smol-toml';
|
|
|
18
18
|
import './fs-operations.mjs';
|
|
19
19
|
import 'node:crypto';
|
|
20
20
|
import 'node:fs/promises';
|
|
21
|
-
import './
|
|
22
|
-
import '
|
|
23
|
-
import 'semver';
|
|
24
|
-
import 'tinyexec';
|
|
21
|
+
import './json-config.mjs';
|
|
22
|
+
import './config.mjs';
|
|
25
23
|
import './platform.mjs';
|
|
26
|
-
import '
|
|
27
|
-
import './package.mjs';
|
|
28
|
-
import 'node:child_process';
|
|
24
|
+
import 'tinyexec';
|
|
29
25
|
import 'inquirer-toggle';
|
|
26
|
+
import './workflows2.mjs';
|
|
30
27
|
|
|
31
28
|
function getAuthTypeLabel(authType) {
|
|
32
29
|
ensureI18nInitialized();
|