ccjk 9.8.1 → 9.10.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/auto-updater.mjs +74 -2
- package/dist/chunks/ccjk-config.mjs +1 -4
- package/dist/chunks/ccr.mjs +1 -1
- package/dist/chunks/check-updates.mjs +1 -1
- package/dist/chunks/features.mjs +1 -1
- package/dist/chunks/init.mjs +1 -1
- package/dist/chunks/menu.mjs +2 -2
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +1 -1
- package/dist/chunks/uninstall.mjs +1 -1
- package/dist/shared/{ccjk.CeE8RLG2.mjs → ccjk.Dpw86UX0.mjs} +7 -15
- package/package.json +1 -1
|
@@ -168,8 +168,16 @@ async function updateClaudeCode(force = false, skipPrompt = false) {
|
|
|
168
168
|
await execWithSudoIfNeeded("claude", ["update"]);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const { commandExists } = await import('./platform.mjs').then(function (n) { return n.p; });
|
|
172
|
+
const claudeWorks = await commandExists("claude");
|
|
173
|
+
if (claudeWorks) {
|
|
174
|
+
updateSpinner.succeed(format(i18n.t("updater:updateSuccess"), { tool: "Claude Code" }));
|
|
175
|
+
} else {
|
|
176
|
+
updateSpinner.warn(format(i18n.t("updater:updateSuccess"), { tool: "Claude Code" }));
|
|
177
|
+
console.log(ansis.yellow(" \u26A0 claude command not found in PATH after update"));
|
|
178
|
+
console.log(ansis.gray(" Try: npm install -g @anthropic-ai/claude-code"));
|
|
179
|
+
}
|
|
180
|
+
return claudeWorks;
|
|
173
181
|
} catch (error) {
|
|
174
182
|
updateSpinner.fail(format(i18n.t("updater:updateFailed"), { tool: "Claude Code" }));
|
|
175
183
|
console.error(ansis.red(error instanceof Error ? error.message : String(error)));
|
|
@@ -244,6 +252,17 @@ async function checkAndUpdateTools(skipPrompt = false) {
|
|
|
244
252
|
console.warn(ansis.yellow(`\u26A0 Duplicate installation check failed: ${errorMessage}`));
|
|
245
253
|
}
|
|
246
254
|
const results = [];
|
|
255
|
+
console.log(ansis.bold("\u{1F4E6} CCJK"));
|
|
256
|
+
try {
|
|
257
|
+
await checkCcjkVersionAndPrompt(skipPrompt);
|
|
258
|
+
results.push({ tool: "CCJK", success: true });
|
|
259
|
+
} catch (error) {
|
|
260
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
261
|
+
console.error(ansis.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCJK" })}: ${errorMessage}`));
|
|
262
|
+
results.push({ tool: "CCJK", success: false, error: errorMessage });
|
|
263
|
+
}
|
|
264
|
+
console.log();
|
|
265
|
+
console.log(ansis.bold("\u{1F500} CCR"));
|
|
247
266
|
try {
|
|
248
267
|
const success = await updateCcr(false, skipPrompt);
|
|
249
268
|
results.push({ tool: "CCR", success });
|
|
@@ -282,5 +301,58 @@ async function checkAndUpdateTools(skipPrompt = false) {
|
|
|
282
301
|
}
|
|
283
302
|
}
|
|
284
303
|
}
|
|
304
|
+
async function checkCcjkVersionAndPrompt(skipPrompt) {
|
|
305
|
+
try {
|
|
306
|
+
const { readFileSync } = await import('node:fs');
|
|
307
|
+
const { fileURLToPath } = await import('node:url');
|
|
308
|
+
const { dirname, join } = await import('pathe');
|
|
309
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
310
|
+
const pkgPath = join(__dirname, "..", "..", "package.json");
|
|
311
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
312
|
+
const currentVersion = pkg.version;
|
|
313
|
+
console.log(ansis.cyan(`${i18n.t("updater:currentVersion")} v${currentVersion}`));
|
|
314
|
+
const { stdout } = await exec("npm", ["view", "ccjk", "version"]);
|
|
315
|
+
const latestVersion = stdout.trim();
|
|
316
|
+
console.log(ansis.cyan(`${i18n.t("updater:latestVersion")} v${latestVersion}`));
|
|
317
|
+
if (currentVersion === latestVersion) {
|
|
318
|
+
console.log(ansis.green(`\u2713 ${i18n.t("updater:alreadyLatest")}`));
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (!skipPrompt) {
|
|
322
|
+
const inquirer = (await import('inquirer')).default;
|
|
323
|
+
const { shouldUpdate } = await inquirer.prompt([
|
|
324
|
+
{
|
|
325
|
+
type: "confirm",
|
|
326
|
+
name: "shouldUpdate",
|
|
327
|
+
message: format(i18n.t("updater:updatePrompt"), { tool: "CCJK", version: latestVersion }),
|
|
328
|
+
default: true
|
|
329
|
+
}
|
|
330
|
+
]);
|
|
331
|
+
if (!shouldUpdate) {
|
|
332
|
+
console.log(ansis.gray(i18n.t("updater:updateSkipped")));
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
console.log(ansis.dim("Clearing npx cache..."));
|
|
337
|
+
try {
|
|
338
|
+
await exec("npm", ["cache", "clean", "--force"]);
|
|
339
|
+
} catch {
|
|
340
|
+
}
|
|
341
|
+
const ora2 = (await import('ora')).default;
|
|
342
|
+
const updateSpinner = ora2("Updating CCJK...").start();
|
|
343
|
+
try {
|
|
344
|
+
await execWithSudoIfNeeded("npm", ["install", "-g", "ccjk@latest", "--force"]);
|
|
345
|
+
updateSpinner.succeed(ansis.green(`\u2713 CCJK updated to v${latestVersion}`));
|
|
346
|
+
console.log(ansis.yellow("\n\u26A0 Please restart ccjk to use the new version"));
|
|
347
|
+
process.exit(0);
|
|
348
|
+
} catch (error) {
|
|
349
|
+
updateSpinner.fail(ansis.red("\u2717 CCJK update failed"));
|
|
350
|
+
console.error(ansis.red(error instanceof Error ? error.message : String(error)));
|
|
351
|
+
console.log(ansis.gray("\nTry manually: npm install -g ccjk@latest"));
|
|
352
|
+
}
|
|
353
|
+
} catch (error) {
|
|
354
|
+
console.error(ansis.red(`${i18n.t("updater:checkFailed")} ${error instanceof Error ? error.message : String(error)}`));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
285
357
|
|
|
286
358
|
export { checkAndUpdateTools, execWithSudoIfNeeded, updateCcr, updateClaudeCode, updateCometixLine };
|
|
@@ -254,11 +254,8 @@ function updateZcfConfig(updates) {
|
|
|
254
254
|
};
|
|
255
255
|
writeZcfConfig(newConfig);
|
|
256
256
|
}
|
|
257
|
-
async function saveZcfConfig(config) {
|
|
258
|
-
writeZcfConfig(config);
|
|
259
|
-
}
|
|
260
257
|
function readDefaultTomlConfig() {
|
|
261
258
|
return readTomlConfig(ZCF_CONFIG_FILE);
|
|
262
259
|
}
|
|
263
260
|
|
|
264
|
-
export { createDefaultTomlConfig, migrateFromJsonConfig, migrateZcfConfigIfNeeded, readDefaultTomlConfig, readTomlConfig, readZcfConfig, readZcfConfigAsync,
|
|
261
|
+
export { createDefaultTomlConfig, migrateFromJsonConfig, migrateZcfConfigIfNeeded, readDefaultTomlConfig, readTomlConfig, readZcfConfig, readZcfConfigAsync, updateTomlConfig, updateZcfConfig, writeTomlConfig, writeZcfConfig };
|
package/dist/chunks/ccr.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import 'node:crypto';
|
|
|
20
20
|
import 'node:fs/promises';
|
|
21
21
|
import './json-config.mjs';
|
|
22
22
|
import 'dayjs';
|
|
23
|
-
import '../shared/ccjk.
|
|
23
|
+
import '../shared/ccjk.Dpw86UX0.mjs';
|
|
24
24
|
import './smart-defaults.mjs';
|
|
25
25
|
import 'node:child_process';
|
|
26
26
|
import './platform.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
2
|
import ansis from 'ansis';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
4
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
4
|
+
import { r as resolveCodeType } from '../shared/ccjk.Dpw86UX0.mjs';
|
|
5
5
|
import { checkAndUpdateTools } from './auto-updater.mjs';
|
|
6
6
|
import { d as runCodexUpdate } from './codex.mjs';
|
|
7
7
|
import 'node:fs';
|
package/dist/chunks/features.mjs
CHANGED
|
@@ -37,7 +37,7 @@ import '../shared/ccjk.Br91zBIG.mjs';
|
|
|
37
37
|
import './auto-updater.mjs';
|
|
38
38
|
import './version-checker.mjs';
|
|
39
39
|
import 'node:path';
|
|
40
|
-
import '../shared/ccjk.
|
|
40
|
+
import '../shared/ccjk.Dpw86UX0.mjs';
|
|
41
41
|
import './smart-defaults.mjs';
|
|
42
42
|
import '../shared/ccjk.DKojSRzw.mjs';
|
|
43
43
|
import '../shared/ccjk.DvIrK0wz.mjs';
|
package/dist/chunks/init.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { promisify } from 'node:util';
|
|
|
15
15
|
import { updateCcr } from './auto-updater.mjs';
|
|
16
16
|
import { w as wrapCommandWithSudo, i as isWindows, a as isTermux } from './platform.mjs';
|
|
17
17
|
import { c as addCompletedOnboarding, s as setPrimaryApiKey, b as backupMcpConfig, a as buildMcpServerConfig, r as readMcpConfig, e as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, g as syncMcpPermissions } from './claude-config.mjs';
|
|
18
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
18
|
+
import { r as resolveCodeType } from '../shared/ccjk.Dpw86UX0.mjs';
|
|
19
19
|
import { exists } from './fs-operations.mjs';
|
|
20
20
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
21
21
|
import { p as promptApiConfigurationAction, e as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, a as copyConfigFiles, d as applyAiLanguageDirective, f as configureApi } from './config.mjs';
|
package/dist/chunks/menu.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { CODE_TOOL_BANNERS, CLAUDE_DIR, isCodeToolType, DEFAULT_CODE_TOOL_TYPE }
|
|
|
7
7
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
8
8
|
import { d as displayBannerWithInfo } from '../shared/ccjk.Br91zBIG.mjs';
|
|
9
9
|
import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
|
|
10
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
10
|
+
import { r as resolveCodeType } from '../shared/ccjk.Dpw86UX0.mjs';
|
|
11
11
|
import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
|
|
12
12
|
import { changeScriptLanguageFeature, configureMcpFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureApiFeature } from './features.mjs';
|
|
13
13
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
|
@@ -381,7 +381,7 @@ async function showSimplifiedMenu() {
|
|
|
381
381
|
switch (normalized) {
|
|
382
382
|
// -------- Claude Code --------
|
|
383
383
|
case "1": {
|
|
384
|
-
await init({ skipBanner: true });
|
|
384
|
+
await init({ skipBanner: true, codeType: "claude-code" });
|
|
385
385
|
break;
|
|
386
386
|
}
|
|
387
387
|
case "2": {
|
package/dist/chunks/package.mjs
CHANGED
|
@@ -39,7 +39,7 @@ import 'node:util';
|
|
|
39
39
|
import './auto-updater.mjs';
|
|
40
40
|
import './version-checker.mjs';
|
|
41
41
|
import 'node:path';
|
|
42
|
-
import '../shared/ccjk.
|
|
42
|
+
import '../shared/ccjk.Dpw86UX0.mjs';
|
|
43
43
|
import '../shared/ccjk.DvIrK0wz.mjs';
|
|
44
44
|
import './installer2.mjs';
|
|
45
45
|
import '../shared/ccjk.DE91nClQ.mjs';
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import { ZCF_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, isCodeToolType } from './constants.mjs';
|
|
4
4
|
import { i18n, ensureI18nInitialized } from './index.mjs';
|
|
5
5
|
import { readZcfConfig } from './ccjk-config.mjs';
|
|
6
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
6
|
+
import { r as resolveCodeType } from '../shared/ccjk.Dpw86UX0.mjs';
|
|
7
7
|
import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
|
|
8
8
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
9
9
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { detectCodeToolType } from '../chunks/smart-defaults.mjs';
|
|
2
2
|
import { DEFAULT_CODE_TOOL_TYPE } from '../chunks/constants.mjs';
|
|
3
3
|
import { i18n } from '../chunks/index.mjs';
|
|
4
|
-
import { readZcfConfigAsync
|
|
4
|
+
import { readZcfConfigAsync } from '../chunks/ccjk-config.mjs';
|
|
5
5
|
|
|
6
6
|
const CODE_TYPE_ABBREVIATIONS = {
|
|
7
7
|
cc: "claude-code",
|
|
@@ -32,24 +32,16 @@ async function resolveCodeType(codeTypeParam) {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
if (isValidCodeType(
|
|
37
|
-
|
|
38
|
-
const config = await readZcfConfigAsync();
|
|
39
|
-
if (config && config.codeToolType !== freshDetected) {
|
|
40
|
-
config.codeToolType = freshDetected;
|
|
41
|
-
await saveZcfConfig(config);
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
return freshDetected;
|
|
35
|
+
const config = await readZcfConfigAsync();
|
|
36
|
+
if (config?.codeToolType && isValidCodeType(config.codeToolType)) {
|
|
37
|
+
return config.codeToolType;
|
|
46
38
|
}
|
|
47
39
|
} catch {
|
|
48
40
|
}
|
|
49
41
|
try {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
42
|
+
const freshDetected = detectCodeToolType();
|
|
43
|
+
if (isValidCodeType(freshDetected)) {
|
|
44
|
+
return freshDetected;
|
|
53
45
|
}
|
|
54
46
|
} catch {
|
|
55
47
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.10.0",
|
|
5
5
|
"packageManager": "pnpm@10.17.1",
|
|
6
6
|
"description": "CCJK v9.0.0 - Revolutionary AI Development Platform with Enterprise Security, Streaming Cloud Sync, CRDT Conflict Resolution, and Unified V3 Architecture",
|
|
7
7
|
"author": {
|