ccjk 9.6.1 → 9.8.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/boost.mjs +246 -7
- package/dist/chunks/ccjk-mcp.mjs +1 -1
- package/dist/chunks/ccr.mjs +25 -28
- package/dist/chunks/check-updates.mjs +4 -3
- package/dist/chunks/claude-code-config-manager.mjs +1 -1
- package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
- package/dist/chunks/claude-config.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +3 -4
- package/dist/chunks/codex-provider-manager.mjs +1 -2
- package/dist/chunks/codex.mjs +204 -3
- package/dist/chunks/config-switch.mjs +2 -3
- package/dist/chunks/config.mjs +1 -1
- package/dist/chunks/doctor.mjs +1 -1
- package/dist/chunks/features.mjs +24 -15
- package/dist/chunks/hook-installer.mjs +44 -0
- package/dist/chunks/index3.mjs +32 -32
- package/dist/chunks/init.mjs +129 -87
- package/dist/chunks/installer2.mjs +1 -1
- package/dist/chunks/interview.mjs +1 -1
- package/dist/chunks/mcp.mjs +1058 -17
- package/dist/chunks/menu.mjs +140 -56
- package/dist/chunks/package.mjs +2 -210
- package/dist/chunks/platform.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +35 -18
- package/dist/chunks/simple-config.mjs +1 -1
- package/dist/{shared/ccjk.q1koQxEE.mjs → chunks/smart-defaults.mjs} +77 -79
- package/dist/chunks/status.mjs +208 -101
- package/dist/chunks/thinking.mjs +1 -1
- package/dist/chunks/uninstall.mjs +6 -4
- package/dist/chunks/update.mjs +4 -7
- package/dist/chunks/version-checker.mjs +1 -1
- package/dist/cli.mjs +4 -80
- package/dist/index.d.mts +17 -1482
- package/dist/index.d.ts +17 -1482
- package/dist/index.mjs +12 -4191
- package/dist/shared/{ccjk.CSkyCZIM.mjs → ccjk.Bndhan7G.mjs} +4 -242
- package/dist/shared/ccjk.CeE8RLG2.mjs +62 -0
- package/dist/shared/ccjk.DKojSRzw.mjs +266 -0
- package/dist/shared/{ccjk.CItD1fpl.mjs → ccjk.DvIrK0wz.mjs} +1 -1
- package/dist/shared/ccjk.LsPZ2PYo.mjs +1048 -0
- package/package.json +1 -1
- package/dist/chunks/api-adapter.mjs +0 -180
- package/dist/chunks/cli.mjs +0 -2227
- package/dist/chunks/context-menu.mjs +0 -913
- package/dist/chunks/hooks-sync.mjs +0 -1627
- package/dist/chunks/mcp-market.mjs +0 -1077
- package/dist/chunks/mcp-server.mjs +0 -776
- package/dist/chunks/project-detector.mjs +0 -131
- package/dist/chunks/provider-registry.mjs +0 -92
- package/dist/chunks/setup-wizard.mjs +0 -362
- package/dist/chunks/tools.mjs +0 -143
- package/dist/chunks/workflows2.mjs +0 -232
- package/dist/shared/ccjk.C0pb50xH.mjs +0 -347
- package/dist/shared/ccjk.ChMkBmdL.mjs +0 -490
- package/dist/shared/ccjk.CtSfXUSh.mjs +0 -209
- package/dist/shared/ccjk.xfAjmbJp.mjs +0 -75
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { exec } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
import ansis from 'ansis';
|
|
4
|
-
import { ensureI18nInitialized, i18n } from '../chunks/index.mjs';
|
|
5
|
-
import { updateCcr } from '../chunks/auto-updater.mjs';
|
|
6
|
-
import { w as wrapCommandWithSudo } from '../chunks/platform.mjs';
|
|
7
|
-
|
|
8
|
-
const execAsync = promisify(exec);
|
|
9
|
-
async function isCcrInstalled() {
|
|
10
|
-
let commandExists = false;
|
|
11
|
-
try {
|
|
12
|
-
await execAsync("ccr version");
|
|
13
|
-
commandExists = true;
|
|
14
|
-
} catch {
|
|
15
|
-
try {
|
|
16
|
-
await execAsync("which ccr");
|
|
17
|
-
commandExists = true;
|
|
18
|
-
} catch {
|
|
19
|
-
commandExists = false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
let hasCorrectPackage = false;
|
|
23
|
-
try {
|
|
24
|
-
await execAsync("npm list -g @musistudio/claude-code-router");
|
|
25
|
-
hasCorrectPackage = true;
|
|
26
|
-
} catch {
|
|
27
|
-
hasCorrectPackage = false;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
isInstalled: commandExists,
|
|
31
|
-
hasCorrectPackage
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
async function installCcr() {
|
|
35
|
-
ensureI18nInitialized();
|
|
36
|
-
const { isInstalled, hasCorrectPackage } = await isCcrInstalled();
|
|
37
|
-
if (hasCorrectPackage) {
|
|
38
|
-
console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
|
|
39
|
-
await updateCcr();
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (isInstalled && !hasCorrectPackage) {
|
|
43
|
-
try {
|
|
44
|
-
await execAsync("npm list -g claude-code-router");
|
|
45
|
-
console.log(ansis.yellow(`\u26A0 ${i18n.t("ccr:detectedIncorrectPackage")}`));
|
|
46
|
-
try {
|
|
47
|
-
await execAsync("npm uninstall -g claude-code-router");
|
|
48
|
-
console.log(ansis.green(`\u2714 ${i18n.t("ccr:uninstalledIncorrectPackage")}`));
|
|
49
|
-
} catch {
|
|
50
|
-
console.log(ansis.yellow(`\u26A0 ${i18n.t("ccr:failedToUninstallIncorrectPackage")}`));
|
|
51
|
-
}
|
|
52
|
-
} catch {
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
console.log(ansis.green(`\u{1F4E6} ${i18n.t("ccr:installingCcr")}`));
|
|
56
|
-
try {
|
|
57
|
-
const installArgs = ["install", "-g", "@musistudio/claude-code-router", "--force"];
|
|
58
|
-
const { command, args, usedSudo } = wrapCommandWithSudo("npm", installArgs);
|
|
59
|
-
if (usedSudo) {
|
|
60
|
-
console.log(ansis.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
|
|
61
|
-
}
|
|
62
|
-
await execAsync([command, ...args].join(" "));
|
|
63
|
-
console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrInstallSuccess")}`));
|
|
64
|
-
} catch (error) {
|
|
65
|
-
if (error.message?.includes("EEXIST")) {
|
|
66
|
-
console.log(ansis.yellow(`\u26A0 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
|
|
67
|
-
await updateCcr();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
console.error(ansis.red(`\u2716 ${i18n.t("ccr:ccrInstallFailed")}`));
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export { installCcr as a, isCcrInstalled as i };
|