ccjk 12.0.7 → 12.0.8
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/package.json +1 -1
- package/dist/chunks/agent-teams.mjs +0 -136
- package/dist/chunks/agent.mjs +0 -1439
- package/dist/chunks/agents.mjs +0 -3778
- package/dist/chunks/api-cli.mjs +0 -132
- package/dist/chunks/api-providers.mjs +0 -129
- package/dist/chunks/api.mjs +0 -112
- package/dist/chunks/auto-bootstrap.mjs +0 -358
- package/dist/chunks/auto-init.mjs +0 -7584
- package/dist/chunks/auto-updater.mjs +0 -410
- package/dist/chunks/banner.mjs +0 -188
- package/dist/chunks/bash.mjs +0 -187
- package/dist/chunks/boost.mjs +0 -397
- package/dist/chunks/ccjk-agents.mjs +0 -414
- package/dist/chunks/ccjk-all.mjs +0 -1028
- package/dist/chunks/ccjk-config.mjs +0 -261
- package/dist/chunks/ccjk-hooks.mjs +0 -1074
- package/dist/chunks/ccjk-mcp.mjs +0 -761
- package/dist/chunks/ccjk-setup.mjs +0 -763
- package/dist/chunks/ccjk-skills.mjs +0 -514
- package/dist/chunks/ccr.mjs +0 -98
- package/dist/chunks/ccu.mjs +0 -40
- package/dist/chunks/check-updates.mjs +0 -108
- package/dist/chunks/claude-code-config-manager.mjs +0 -750
- package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
- package/dist/chunks/claude-config.mjs +0 -236
- package/dist/chunks/claude-wrapper.mjs +0 -85
- package/dist/chunks/cleanup-migration.mjs +0 -20
- package/dist/chunks/cli-hook.mjs +0 -2285
- package/dist/chunks/cloud-sync.mjs +0 -29
- package/dist/chunks/codex-config-switch.mjs +0 -451
- package/dist/chunks/codex-provider-manager.mjs +0 -236
- package/dist/chunks/codex-uninstaller.mjs +0 -404
- package/dist/chunks/codex.mjs +0 -2077
- package/dist/chunks/commands.mjs +0 -108
- package/dist/chunks/commands2.mjs +0 -413
- package/dist/chunks/commit.mjs +0 -138
- package/dist/chunks/completion.mjs +0 -515
- package/dist/chunks/config-consolidator.mjs +0 -172
- package/dist/chunks/config-switch.mjs +0 -317
- package/dist/chunks/config.mjs +0 -379
- package/dist/chunks/config2.mjs +0 -477
- package/dist/chunks/config3.mjs +0 -470
- package/dist/chunks/constants.mjs +0 -133
- package/dist/chunks/context-loader.mjs +0 -343
- package/dist/chunks/context.mjs +0 -372
- package/dist/chunks/convoy-manager.mjs +0 -880
- package/dist/chunks/dashboard.mjs +0 -476
- package/dist/chunks/doctor.mjs +0 -964
- package/dist/chunks/evolution.mjs +0 -382
- package/dist/chunks/features.mjs +0 -698
- package/dist/chunks/fish.mjs +0 -181
- package/dist/chunks/fs-operations.mjs +0 -192
- package/dist/chunks/health-alerts.mjs +0 -304
- package/dist/chunks/health-check.mjs +0 -532
- package/dist/chunks/help.mjs +0 -340
- package/dist/chunks/hook-installer.mjs +0 -45
- package/dist/chunks/index.mjs +0 -24
- package/dist/chunks/index10.mjs +0 -1171
- package/dist/chunks/index11.mjs +0 -1008
- package/dist/chunks/index12.mjs +0 -193
- package/dist/chunks/index13.mjs +0 -218
- package/dist/chunks/index14.mjs +0 -663
- package/dist/chunks/index2.mjs +0 -19
- package/dist/chunks/index3.mjs +0 -19092
- package/dist/chunks/index4.mjs +0 -8
- package/dist/chunks/index5.mjs +0 -7600
- package/dist/chunks/index6.mjs +0 -171
- package/dist/chunks/index7.mjs +0 -3583
- package/dist/chunks/index8.mjs +0 -19
- package/dist/chunks/index9.mjs +0 -616
- package/dist/chunks/init.mjs +0 -1606
- package/dist/chunks/installer.mjs +0 -690
- package/dist/chunks/installer2.mjs +0 -179
- package/dist/chunks/interview.mjs +0 -2927
- package/dist/chunks/json-config.mjs +0 -60
- package/dist/chunks/linux.mjs +0 -3863
- package/dist/chunks/macos.mjs +0 -69
- package/dist/chunks/main.mjs +0 -635
- package/dist/chunks/manager.mjs +0 -1048
- package/dist/chunks/marketplace.mjs +0 -949
- package/dist/chunks/mcp-cli.mjs +0 -204
- package/dist/chunks/mcp-performance.mjs +0 -187
- package/dist/chunks/mcp.mjs +0 -1231
- package/dist/chunks/menu.mjs +0 -652
- package/dist/chunks/metrics-display.mjs +0 -153
- package/dist/chunks/migrator.mjs +0 -178
- package/dist/chunks/monitor.mjs +0 -1856
- package/dist/chunks/notification.mjs +0 -1864
- package/dist/chunks/onboarding.mjs +0 -385
- package/dist/chunks/package.mjs +0 -3
- package/dist/chunks/paradigm.mjs +0 -74
- package/dist/chunks/permission-manager.mjs +0 -132
- package/dist/chunks/permissions.mjs +0 -265
- package/dist/chunks/persistence-manager.mjs +0 -794
- package/dist/chunks/persistence.mjs +0 -667
- package/dist/chunks/platform.mjs +0 -391
- package/dist/chunks/plugin.mjs +0 -1936
- package/dist/chunks/powershell.mjs +0 -213
- package/dist/chunks/prompts.mjs +0 -241
- package/dist/chunks/providers.mjs +0 -260
- package/dist/chunks/quick-actions.mjs +0 -320
- package/dist/chunks/quick-provider.mjs +0 -682
- package/dist/chunks/quick-setup.mjs +0 -412
- package/dist/chunks/remote.mjs +0 -497
- package/dist/chunks/session.mjs +0 -878
- package/dist/chunks/sessions.mjs +0 -106
- package/dist/chunks/silent-updater.mjs +0 -396
- package/dist/chunks/simple-config.mjs +0 -98
- package/dist/chunks/skill.mjs +0 -117
- package/dist/chunks/skill2.mjs +0 -9003
- package/dist/chunks/skills-sync.mjs +0 -6460
- package/dist/chunks/skills.mjs +0 -567
- package/dist/chunks/slash-commands.mjs +0 -207
- package/dist/chunks/smart-defaults.mjs +0 -412
- package/dist/chunks/smart-guide.mjs +0 -194
- package/dist/chunks/startup.mjs +0 -487
- package/dist/chunks/stats.mjs +0 -410
- package/dist/chunks/status.mjs +0 -289
- package/dist/chunks/team.mjs +0 -63
- package/dist/chunks/thinking.mjs +0 -626
- package/dist/chunks/trace.mjs +0 -57
- package/dist/chunks/uninstall.mjs +0 -849
- package/dist/chunks/update.mjs +0 -167
- package/dist/chunks/upgrade-manager.mjs +0 -204
- package/dist/chunks/version-checker.mjs +0 -881
- package/dist/chunks/vim.mjs +0 -903
- package/dist/chunks/windows.mjs +0 -14
- package/dist/chunks/workflows.mjs +0 -633
- package/dist/chunks/wsl.mjs +0 -129
- package/dist/chunks/zero-config.mjs +0 -374
- package/dist/chunks/zsh.mjs +0 -182
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +0 -2199
- package/dist/i18n/locales/en/agent-teams.json +0 -18
- package/dist/i18n/locales/en/agentBrowser.json +0 -79
- package/dist/i18n/locales/en/agents.json +0 -135
- package/dist/i18n/locales/en/api.json +0 -63
- package/dist/i18n/locales/en/ccjk-agents.json +0 -33
- package/dist/i18n/locales/en/ccjk-all.json +0 -23
- package/dist/i18n/locales/en/ccjk-skills.json +0 -22
- package/dist/i18n/locales/en/ccjk.json +0 -276
- package/dist/i18n/locales/en/ccr.json +0 -65
- package/dist/i18n/locales/en/claude-md.json +0 -73
- package/dist/i18n/locales/en/cli.json +0 -152
- package/dist/i18n/locales/en/cloud-setup.json +0 -31
- package/dist/i18n/locales/en/cloud-sync.json +0 -147
- package/dist/i18n/locales/en/cloud.json +0 -40
- package/dist/i18n/locales/en/cloudPlugins.json +0 -118
- package/dist/i18n/locales/en/codex.json +0 -127
- package/dist/i18n/locales/en/cometix.json +0 -29
- package/dist/i18n/locales/en/common.json +0 -68
- package/dist/i18n/locales/en/config.json +0 -108
- package/dist/i18n/locales/en/configuration.json +0 -226
- package/dist/i18n/locales/en/context.json +0 -85
- package/dist/i18n/locales/en/dashboard.json +0 -78
- package/dist/i18n/locales/en/errors.json +0 -26
- package/dist/i18n/locales/en/evolution.json +0 -54
- package/dist/i18n/locales/en/hooks.json +0 -74
- package/dist/i18n/locales/en/hooksSync.json +0 -133
- package/dist/i18n/locales/en/installation.json +0 -83
- package/dist/i18n/locales/en/interview.json +0 -104
- package/dist/i18n/locales/en/language.json +0 -19
- package/dist/i18n/locales/en/lsp.json +0 -78
- package/dist/i18n/locales/en/marketplace.json +0 -116
- package/dist/i18n/locales/en/mcp.json +0 -178
- package/dist/i18n/locales/en/memory.json +0 -92
- package/dist/i18n/locales/en/menu.json +0 -143
- package/dist/i18n/locales/en/multi-config.json +0 -79
- package/dist/i18n/locales/en/notification.json +0 -307
- package/dist/i18n/locales/en/permissions.json +0 -95
- package/dist/i18n/locales/en/persistence.json +0 -127
- package/dist/i18n/locales/en/plugins.json +0 -146
- package/dist/i18n/locales/en/quick-actions.json +0 -78
- package/dist/i18n/locales/en/registry.json +0 -54
- package/dist/i18n/locales/en/remote.json +0 -93
- package/dist/i18n/locales/en/sandbox.json +0 -44
- package/dist/i18n/locales/en/setup.json +0 -44
- package/dist/i18n/locales/en/shencha.json +0 -14
- package/dist/i18n/locales/en/skills.json +0 -100
- package/dist/i18n/locales/en/skillsSync.json +0 -74
- package/dist/i18n/locales/en/smartGuide.json +0 -49
- package/dist/i18n/locales/en/stats.json +0 -20
- package/dist/i18n/locales/en/subagent.json +0 -69
- package/dist/i18n/locales/en/superpowers.json +0 -117
- package/dist/i18n/locales/en/team.json +0 -7
- package/dist/i18n/locales/en/thinking.json +0 -65
- package/dist/i18n/locales/en/tools.json +0 -42
- package/dist/i18n/locales/en/uninstall.json +0 -56
- package/dist/i18n/locales/en/updater.json +0 -29
- package/dist/i18n/locales/en/vim.json +0 -169
- package/dist/i18n/locales/en/workflow.json +0 -55
- package/dist/i18n/locales/en/workspace.json +0 -108
- package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
- package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
- package/dist/i18n/locales/zh-CN/agents.json +0 -135
- package/dist/i18n/locales/zh-CN/api.json +0 -63
- package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
- package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
- package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
- package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
- package/dist/i18n/locales/zh-CN/ccr.json +0 -65
- package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
- package/dist/i18n/locales/zh-CN/cli.json +0 -152
- package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
- package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
- package/dist/i18n/locales/zh-CN/cloud.json +0 -40
- package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
- package/dist/i18n/locales/zh-CN/codex.json +0 -127
- package/dist/i18n/locales/zh-CN/cometix.json +0 -29
- package/dist/i18n/locales/zh-CN/common.json +0 -68
- package/dist/i18n/locales/zh-CN/config.json +0 -108
- package/dist/i18n/locales/zh-CN/configuration.json +0 -224
- package/dist/i18n/locales/zh-CN/context.json +0 -85
- package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
- package/dist/i18n/locales/zh-CN/errors.json +0 -26
- package/dist/i18n/locales/zh-CN/evolution.json +0 -54
- package/dist/i18n/locales/zh-CN/hooks.json +0 -74
- package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
- package/dist/i18n/locales/zh-CN/installation.json +0 -83
- package/dist/i18n/locales/zh-CN/interview.json +0 -104
- package/dist/i18n/locales/zh-CN/language.json +0 -19
- package/dist/i18n/locales/zh-CN/lsp.json +0 -78
- package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
- package/dist/i18n/locales/zh-CN/mcp.json +0 -178
- package/dist/i18n/locales/zh-CN/memory.json +0 -92
- package/dist/i18n/locales/zh-CN/menu.json +0 -143
- package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
- package/dist/i18n/locales/zh-CN/notification.json +0 -307
- package/dist/i18n/locales/zh-CN/permissions.json +0 -95
- package/dist/i18n/locales/zh-CN/persistence.json +0 -127
- package/dist/i18n/locales/zh-CN/plugins.json +0 -146
- package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
- package/dist/i18n/locales/zh-CN/registry.json +0 -54
- package/dist/i18n/locales/zh-CN/remote.json +0 -93
- package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
- package/dist/i18n/locales/zh-CN/setup.json +0 -44
- package/dist/i18n/locales/zh-CN/shencha.json +0 -14
- package/dist/i18n/locales/zh-CN/skills.json +0 -100
- package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
- package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
- package/dist/i18n/locales/zh-CN/stats.json +0 -20
- package/dist/i18n/locales/zh-CN/subagent.json +0 -69
- package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
- package/dist/i18n/locales/zh-CN/team.json +0 -7
- package/dist/i18n/locales/zh-CN/thinking.json +0 -65
- package/dist/i18n/locales/zh-CN/tools.json +0 -42
- package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
- package/dist/i18n/locales/zh-CN/updater.json +0 -29
- package/dist/i18n/locales/zh-CN/vim.json +0 -169
- package/dist/i18n/locales/zh-CN/workflow.json +0 -55
- package/dist/i18n/locales/zh-CN/workspace.json +0 -108
- package/dist/index.d.mts +0 -5295
- package/dist/index.d.ts +0 -5295
- package/dist/index.mjs +0 -4941
- package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
- package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
- package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
- package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
- package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
- package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
- package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
- package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
- package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
- package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
- package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
- package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
- package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
- package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
- package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
- package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
- package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
- package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
- package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
- package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
- package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
- package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
- package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
- package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
- package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
- package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
- package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
- package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
- package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
- package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
- package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
- package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
- package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
- package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
- package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
- package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
- package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
- package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
- package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
- package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
- package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
- package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
package/dist/chunks/config2.mjs
DELETED
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import { exec } from 'node:child_process';
|
|
2
|
-
import { existsSync, copyFileSync, mkdirSync } from 'node:fs';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
|
-
import process__default from 'node:process';
|
|
5
|
-
import { promisify } from 'node:util';
|
|
6
|
-
import a from './index2.mjs';
|
|
7
|
-
import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
8
|
-
import { i as inquirer } from './index3.mjs';
|
|
9
|
-
import { SETTINGS_FILE } from './constants.mjs';
|
|
10
|
-
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
11
|
-
import { s as setPrimaryApiKey, c as addCompletedOnboarding } from './claude-config.mjs';
|
|
12
|
-
import { b as backupExistingConfig } from './config.mjs';
|
|
13
|
-
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
14
|
-
import { p as promptBoolean } from '../shared/ccjk.DOwtZMk8.mjs';
|
|
15
|
-
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
16
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
17
|
-
import 'node:readline';
|
|
18
|
-
import 'stream';
|
|
19
|
-
import 'node:tty';
|
|
20
|
-
import 'node:async_hooks';
|
|
21
|
-
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
22
|
-
import 'tty';
|
|
23
|
-
import 'fs';
|
|
24
|
-
import 'child_process';
|
|
25
|
-
import 'node:path';
|
|
26
|
-
import 'node:crypto';
|
|
27
|
-
import 'buffer';
|
|
28
|
-
import 'string_decoder';
|
|
29
|
-
import 'node:url';
|
|
30
|
-
import './platform.mjs';
|
|
31
|
-
import './main.mjs';
|
|
32
|
-
import 'module';
|
|
33
|
-
import 'node:stream';
|
|
34
|
-
import './fs-operations.mjs';
|
|
35
|
-
import 'node:fs/promises';
|
|
36
|
-
import '../shared/ccjk.DXRAZcix.mjs';
|
|
37
|
-
|
|
38
|
-
const PROVIDER_PRESETS_URL = "https://pub-0dc3e1677e894f07bbea11b17a29e032.r2.dev/providers.json";
|
|
39
|
-
async function fetchProviderPresets() {
|
|
40
|
-
try {
|
|
41
|
-
const controller = new AbortController();
|
|
42
|
-
const timeoutId = setTimeout(() => controller.abort(), 5e3);
|
|
43
|
-
const response = await fetch(PROVIDER_PRESETS_URL, {
|
|
44
|
-
signal: controller.signal
|
|
45
|
-
});
|
|
46
|
-
clearTimeout(timeoutId);
|
|
47
|
-
if (!response.ok) {
|
|
48
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
49
|
-
}
|
|
50
|
-
const data = await response.json();
|
|
51
|
-
const presets = [];
|
|
52
|
-
if (Array.isArray(data)) {
|
|
53
|
-
for (const provider of data) {
|
|
54
|
-
if (provider && typeof provider === "object") {
|
|
55
|
-
presets.push({
|
|
56
|
-
name: provider.name || "",
|
|
57
|
-
provider: provider.name || "",
|
|
58
|
-
baseURL: provider.api_base_url || provider.baseURL || provider.url,
|
|
59
|
-
requiresApiKey: provider.api_key === "" || provider.requiresApiKey !== false,
|
|
60
|
-
models: provider.models || [],
|
|
61
|
-
description: provider.description || provider.name || "",
|
|
62
|
-
transformer: provider.transformer
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} else if (data && typeof data === "object") {
|
|
67
|
-
for (const [key, value] of Object.entries(data)) {
|
|
68
|
-
if (typeof value === "object" && value !== null) {
|
|
69
|
-
const provider = value;
|
|
70
|
-
presets.push({
|
|
71
|
-
name: provider.name || key,
|
|
72
|
-
provider: key,
|
|
73
|
-
baseURL: provider.api_base_url || provider.baseURL || provider.url,
|
|
74
|
-
requiresApiKey: provider.api_key === "" || provider.requiresApiKey !== false,
|
|
75
|
-
models: provider.models || [],
|
|
76
|
-
description: provider.description || "",
|
|
77
|
-
transformer: provider.transformer
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return presets;
|
|
83
|
-
} catch {
|
|
84
|
-
return getFallbackPresets();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function getFallbackPresets() {
|
|
88
|
-
return [
|
|
89
|
-
{
|
|
90
|
-
name: "dashscope",
|
|
91
|
-
provider: "dashscope",
|
|
92
|
-
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
93
|
-
requiresApiKey: true,
|
|
94
|
-
models: ["qwen3-coder-plus"],
|
|
95
|
-
description: "Alibaba DashScope",
|
|
96
|
-
transformer: {
|
|
97
|
-
"use": [["maxtoken", { max_tokens: 65536 }]],
|
|
98
|
-
"qwen3-coder-plus": {
|
|
99
|
-
use: ["enhancetool"]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "deepseek",
|
|
105
|
-
provider: "deepseek",
|
|
106
|
-
baseURL: "https://api.deepseek.com/chat/completions",
|
|
107
|
-
requiresApiKey: true,
|
|
108
|
-
models: ["deepseek-chat", "deepseek-reasoner"],
|
|
109
|
-
description: "DeepSeek AI models",
|
|
110
|
-
transformer: {
|
|
111
|
-
"use": ["deepseek"],
|
|
112
|
-
"deepseek-chat": {
|
|
113
|
-
use: ["tooluse"]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "gemini",
|
|
119
|
-
provider: "gemini",
|
|
120
|
-
baseURL: "https://generativelanguage.googleapis.com/v1beta/models/",
|
|
121
|
-
requiresApiKey: true,
|
|
122
|
-
models: ["gemini-2.5-flash", "gemini-2.5-pro"],
|
|
123
|
-
description: "Google Gemini models",
|
|
124
|
-
transformer: {
|
|
125
|
-
use: ["gemini"]
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: "modelscope",
|
|
130
|
-
provider: "modelscope",
|
|
131
|
-
baseURL: "https://api-inference.modelscope.cn/v1/chat/completions",
|
|
132
|
-
requiresApiKey: true,
|
|
133
|
-
models: ["Qwen/Qwen3-Coder-480B-A35B-Instruct", "Qwen/Qwen3-235B-A22B-Thinking-2507", "ZhipuAI/GLM-4.5"],
|
|
134
|
-
description: "ModelScope AI models",
|
|
135
|
-
transformer: {
|
|
136
|
-
"use": [["maxtoken", { max_tokens: 65536 }]],
|
|
137
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct": {
|
|
138
|
-
use: ["enhancetool"]
|
|
139
|
-
},
|
|
140
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507": {
|
|
141
|
-
use: ["reasoning"]
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "openrouter",
|
|
147
|
-
provider: "openrouter",
|
|
148
|
-
baseURL: "https://openrouter.ai/api/v1/chat/completions",
|
|
149
|
-
requiresApiKey: true,
|
|
150
|
-
models: [
|
|
151
|
-
"google/gemini-2.5-pro-preview",
|
|
152
|
-
"anthropic/claude-sonnet-4",
|
|
153
|
-
"anthropic/claude-3.5-sonnet",
|
|
154
|
-
"anthropic/claude-3.7-sonnet:thinking"
|
|
155
|
-
],
|
|
156
|
-
description: "OpenRouter API",
|
|
157
|
-
transformer: {
|
|
158
|
-
use: ["openrouter"]
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "siliconflow",
|
|
163
|
-
provider: "siliconflow",
|
|
164
|
-
baseURL: "https://api.siliconflow.cn/v1/chat/completions",
|
|
165
|
-
requiresApiKey: true,
|
|
166
|
-
models: ["moonshotai/Kimi-K2-Instruct"],
|
|
167
|
-
description: "SiliconFlow AI",
|
|
168
|
-
transformer: {
|
|
169
|
-
use: [["maxtoken", { max_tokens: 16384 }]]
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "volcengine",
|
|
174
|
-
provider: "volcengine",
|
|
175
|
-
baseURL: "https://ark.cn-beijing.volces.com/api/v3/chat/completions",
|
|
176
|
-
requiresApiKey: true,
|
|
177
|
-
models: ["deepseek-v3-250324", "deepseek-r1-250528"],
|
|
178
|
-
description: "Volcengine AI",
|
|
179
|
-
transformer: {
|
|
180
|
-
use: ["deepseek"]
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const execAsync = promisify(exec);
|
|
187
|
-
const CCR_CONFIG_DIR = join(homedir(), ".claude-code-router");
|
|
188
|
-
const CCR_CONFIG_FILE = join(CCR_CONFIG_DIR, "config.json");
|
|
189
|
-
const CCR_BACKUP_DIR = CCR_CONFIG_DIR;
|
|
190
|
-
function ensureCcrConfigDir() {
|
|
191
|
-
if (!existsSync(CCR_CONFIG_DIR)) {
|
|
192
|
-
mkdirSync(CCR_CONFIG_DIR, { recursive: true });
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async function backupCcrConfig() {
|
|
196
|
-
ensureI18nInitialized();
|
|
197
|
-
try {
|
|
198
|
-
if (!existsSync(CCR_CONFIG_FILE)) {
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
const timestamp = `${dayjs().format("YYYY-MM-DDTHH-mm-ss-SSS")}Z`;
|
|
202
|
-
const backupFileName = `config.json.${timestamp}.bak`;
|
|
203
|
-
const backupPath = join(CCR_BACKUP_DIR, backupFileName);
|
|
204
|
-
console.log(a.green(`${i18n.t("ccr:backupCcrConfig")}`));
|
|
205
|
-
copyFileSync(CCR_CONFIG_FILE, backupPath);
|
|
206
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrBackupSuccess").replace("{path}", backupPath)}`));
|
|
207
|
-
return backupPath;
|
|
208
|
-
} catch (error) {
|
|
209
|
-
console.error(a.red(`${i18n.t("ccr:ccrBackupFailed")}:`), error.message);
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function readCcrConfig() {
|
|
214
|
-
if (!existsSync(CCR_CONFIG_FILE)) {
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
return readJsonConfig(CCR_CONFIG_FILE);
|
|
218
|
-
}
|
|
219
|
-
function writeCcrConfig(config) {
|
|
220
|
-
ensureCcrConfigDir();
|
|
221
|
-
writeJsonConfig(CCR_CONFIG_FILE, config);
|
|
222
|
-
}
|
|
223
|
-
async function configureCcrProxy(ccrConfig) {
|
|
224
|
-
const settings = readJsonConfig(SETTINGS_FILE) || {};
|
|
225
|
-
const host = ccrConfig.HOST || "127.0.0.1";
|
|
226
|
-
const port = ccrConfig.PORT || 3456;
|
|
227
|
-
const apiKey = ccrConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
228
|
-
if (!settings.env) {
|
|
229
|
-
settings.env = {};
|
|
230
|
-
}
|
|
231
|
-
delete settings.env.ANTHROPIC_AUTH_TOKEN;
|
|
232
|
-
settings.env.ANTHROPIC_BASE_URL = `http://${host}:${port}`;
|
|
233
|
-
settings.env.ANTHROPIC_API_KEY = apiKey;
|
|
234
|
-
writeJsonConfig(SETTINGS_FILE, settings);
|
|
235
|
-
try {
|
|
236
|
-
setPrimaryApiKey();
|
|
237
|
-
} catch (error) {
|
|
238
|
-
ensureI18nInitialized();
|
|
239
|
-
console.error(i18n.t("mcp:primaryApiKeySetFailed"), error);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
async function selectCcrPreset() {
|
|
243
|
-
ensureI18nInitialized();
|
|
244
|
-
console.log(a.green(`${i18n.t("ccr:fetchingPresets")}`));
|
|
245
|
-
const presets = await fetchProviderPresets();
|
|
246
|
-
if (!presets || presets.length === 0) {
|
|
247
|
-
console.log(a.yellow(`${i18n.t("ccr:noPresetsAvailable")}`));
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
try {
|
|
251
|
-
const choices = [
|
|
252
|
-
{
|
|
253
|
-
name: `1. ${i18n.t("ccr:skipOption")}`,
|
|
254
|
-
value: "skip"
|
|
255
|
-
},
|
|
256
|
-
...presets.map((p, index) => ({
|
|
257
|
-
name: `${index + 2}. ${p.name}`,
|
|
258
|
-
value: p
|
|
259
|
-
}))
|
|
260
|
-
];
|
|
261
|
-
const { preset } = await inquirer.prompt({
|
|
262
|
-
type: "list",
|
|
263
|
-
name: "preset",
|
|
264
|
-
message: i18n.t("ccr:selectCcrPreset"),
|
|
265
|
-
choices
|
|
266
|
-
});
|
|
267
|
-
return preset;
|
|
268
|
-
} catch (error) {
|
|
269
|
-
if (error.name === "ExitPromptError") {
|
|
270
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
throw error;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
async function configureCcrWithPreset(preset) {
|
|
277
|
-
ensureI18nInitialized();
|
|
278
|
-
const provider = {
|
|
279
|
-
name: preset.name,
|
|
280
|
-
// Use the original name from JSON
|
|
281
|
-
api_base_url: preset.baseURL || "",
|
|
282
|
-
api_key: "",
|
|
283
|
-
models: preset.models
|
|
284
|
-
};
|
|
285
|
-
if (preset.transformer) {
|
|
286
|
-
provider.transformer = preset.transformer;
|
|
287
|
-
}
|
|
288
|
-
if (preset.requiresApiKey) {
|
|
289
|
-
try {
|
|
290
|
-
const { apiKey } = await inquirer.prompt({
|
|
291
|
-
type: "input",
|
|
292
|
-
name: "apiKey",
|
|
293
|
-
message: i18n.t("ccr:enterApiKeyForProvider").replace("{provider}", preset.name),
|
|
294
|
-
validate: async (value) => !!value || i18n.t("api:keyRequired")
|
|
295
|
-
});
|
|
296
|
-
provider.api_key = apiKey;
|
|
297
|
-
} catch (error) {
|
|
298
|
-
if (error.name === "ExitPromptError") {
|
|
299
|
-
throw error;
|
|
300
|
-
}
|
|
301
|
-
throw error;
|
|
302
|
-
}
|
|
303
|
-
} else {
|
|
304
|
-
provider.api_key = "sk-free";
|
|
305
|
-
}
|
|
306
|
-
let defaultModel = preset.models[0];
|
|
307
|
-
if (preset.models.length > 1) {
|
|
308
|
-
try {
|
|
309
|
-
const { model } = await inquirer.prompt({
|
|
310
|
-
type: "list",
|
|
311
|
-
name: "model",
|
|
312
|
-
message: i18n.t("ccr:selectDefaultModelForProvider").replace("{provider}", preset.name),
|
|
313
|
-
choices: preset.models.map((m, index) => ({
|
|
314
|
-
name: `${index + 1}. ${m}`,
|
|
315
|
-
value: m
|
|
316
|
-
}))
|
|
317
|
-
});
|
|
318
|
-
defaultModel = model;
|
|
319
|
-
} catch (error) {
|
|
320
|
-
if (error.name === "ExitPromptError") {
|
|
321
|
-
throw error;
|
|
322
|
-
}
|
|
323
|
-
throw error;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
const router = {
|
|
327
|
-
default: `${preset.name},${defaultModel}`,
|
|
328
|
-
// Use the original name
|
|
329
|
-
background: `${preset.name},${defaultModel}`,
|
|
330
|
-
think: `${preset.name},${defaultModel}`,
|
|
331
|
-
longContext: `${preset.name},${defaultModel}`,
|
|
332
|
-
longContextThreshold: 6e4,
|
|
333
|
-
webSearch: `${preset.name},${defaultModel}`
|
|
334
|
-
};
|
|
335
|
-
const config = {
|
|
336
|
-
LOG: true,
|
|
337
|
-
CLAUDE_PATH: "",
|
|
338
|
-
HOST: "127.0.0.1",
|
|
339
|
-
PORT: 3456,
|
|
340
|
-
APIKEY: "sk-ccjk-x-ccr",
|
|
341
|
-
API_TIMEOUT_MS: "600000",
|
|
342
|
-
PROXY_URL: "",
|
|
343
|
-
transformers: [],
|
|
344
|
-
Providers: [provider],
|
|
345
|
-
Router: router
|
|
346
|
-
};
|
|
347
|
-
return config;
|
|
348
|
-
}
|
|
349
|
-
async function restartAndCheckCcrStatus() {
|
|
350
|
-
ensureI18nInitialized();
|
|
351
|
-
try {
|
|
352
|
-
console.log(a.green(`${i18n.t("ccr:restartingCcr")}`));
|
|
353
|
-
await execAsync("ccr restart");
|
|
354
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrRestartSuccess")}`));
|
|
355
|
-
console.log(a.green(`${i18n.t("ccr:checkingCcrStatus")}`));
|
|
356
|
-
const { stdout } = await execAsync("ccr status");
|
|
357
|
-
console.log(a.gray(stdout));
|
|
358
|
-
} catch (error) {
|
|
359
|
-
console.error(a.red(`${i18n.t("ccr:ccrRestartFailed")}:`), error.message || error);
|
|
360
|
-
if (process__default.env.DEBUG) {
|
|
361
|
-
console.error("Full error:", error);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
async function showConfigurationTips(apiKey) {
|
|
366
|
-
ensureI18nInitialized();
|
|
367
|
-
console.log(a.bold.cyan(`
|
|
368
|
-
\u{1F4CC} ${i18n.t("ccr:configTips")}:`));
|
|
369
|
-
console.log(a.green(` \u2022 ${i18n.t("ccr:advancedConfigTip")}`));
|
|
370
|
-
console.log(a.green(` \u2022 ${i18n.t("ccr:manualConfigTip")}`));
|
|
371
|
-
console.log(a.bold.yellow(` \u2022 ${i18n.t("ccr:useClaudeCommand")}`));
|
|
372
|
-
if (apiKey) {
|
|
373
|
-
console.log(a.bold.green(` \u2022 ${i18n.t("ccr:ccrUiApiKey") || "CCR UI API Key"}: ${apiKey}`));
|
|
374
|
-
console.log(a.gray(` ${i18n.t("ccr:ccrUiApiKeyHint") || "Use this API key to login to CCR UI"}`));
|
|
375
|
-
}
|
|
376
|
-
console.log("");
|
|
377
|
-
}
|
|
378
|
-
function createDefaultCcrConfig() {
|
|
379
|
-
return {
|
|
380
|
-
LOG: false,
|
|
381
|
-
CLAUDE_PATH: "",
|
|
382
|
-
HOST: "127.0.0.1",
|
|
383
|
-
PORT: 3456,
|
|
384
|
-
APIKEY: "sk-ccjk-x-ccr",
|
|
385
|
-
API_TIMEOUT_MS: "600000",
|
|
386
|
-
PROXY_URL: "",
|
|
387
|
-
transformers: [],
|
|
388
|
-
Providers: [],
|
|
389
|
-
// Empty providers array - user configures in UI
|
|
390
|
-
Router: {}
|
|
391
|
-
// Empty router configuration - user configures in UI
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
async function setupCcrConfiguration() {
|
|
395
|
-
ensureI18nInitialized();
|
|
396
|
-
try {
|
|
397
|
-
const existingConfig = readCcrConfig();
|
|
398
|
-
if (existingConfig) {
|
|
399
|
-
console.log(a.green(`\u2139 ${i18n.t("ccr:existingCcrConfig")}`));
|
|
400
|
-
let shouldBackupAndReconfigure = false;
|
|
401
|
-
try {
|
|
402
|
-
shouldBackupAndReconfigure = await promptBoolean({
|
|
403
|
-
message: i18n.t("ccr:overwriteCcrConfig"),
|
|
404
|
-
defaultValue: false
|
|
405
|
-
});
|
|
406
|
-
} catch (error) {
|
|
407
|
-
if (error.name === "ExitPromptError") {
|
|
408
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
throw error;
|
|
412
|
-
}
|
|
413
|
-
if (!shouldBackupAndReconfigure) {
|
|
414
|
-
console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
|
|
415
|
-
await configureCcrProxy(existingConfig);
|
|
416
|
-
try {
|
|
417
|
-
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
|
|
418
|
-
const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
419
|
-
manageApiKeyApproval(apiKey);
|
|
420
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
421
|
-
} catch (error) {
|
|
422
|
-
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
|
423
|
-
}
|
|
424
|
-
return true;
|
|
425
|
-
}
|
|
426
|
-
backupCcrConfig();
|
|
427
|
-
}
|
|
428
|
-
const preset = await selectCcrPreset();
|
|
429
|
-
if (!preset) {
|
|
430
|
-
return false;
|
|
431
|
-
}
|
|
432
|
-
let config;
|
|
433
|
-
if (preset === "skip") {
|
|
434
|
-
console.log(a.yellow(`${i18n.t("ccr:skipConfiguring")}`));
|
|
435
|
-
config = createDefaultCcrConfig();
|
|
436
|
-
} else {
|
|
437
|
-
config = await configureCcrWithPreset(preset);
|
|
438
|
-
}
|
|
439
|
-
writeCcrConfig(config);
|
|
440
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
|
|
441
|
-
await configureCcrProxy(config);
|
|
442
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
|
|
443
|
-
await restartAndCheckCcrStatus();
|
|
444
|
-
await showConfigurationTips(config.APIKEY);
|
|
445
|
-
try {
|
|
446
|
-
addCompletedOnboarding();
|
|
447
|
-
} catch (error) {
|
|
448
|
-
console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
|
|
449
|
-
}
|
|
450
|
-
try {
|
|
451
|
-
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
|
|
452
|
-
const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
|
|
453
|
-
manageApiKeyApproval(apiKey);
|
|
454
|
-
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
455
|
-
} catch (error) {
|
|
456
|
-
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
|
457
|
-
}
|
|
458
|
-
return true;
|
|
459
|
-
} catch (error) {
|
|
460
|
-
if (error.name === "ExitPromptError") {
|
|
461
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
462
|
-
return false;
|
|
463
|
-
}
|
|
464
|
-
console.error(a.red(`${i18n.t("ccr:ccrConfigFailed")}:`), error);
|
|
465
|
-
return false;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
async function configureCcrFeature() {
|
|
469
|
-
ensureI18nInitialized();
|
|
470
|
-
const backupDir = backupExistingConfig();
|
|
471
|
-
if (backupDir) {
|
|
472
|
-
console.log(a.gray(`\u2714 ${i18n.t("configuration:backupSuccess")}: ${backupDir}`));
|
|
473
|
-
}
|
|
474
|
-
await setupCcrConfiguration();
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
export { backupCcrConfig, configureCcrFeature, configureCcrProxy, configureCcrWithPreset, createDefaultCcrConfig, ensureCcrConfigDir, readCcrConfig, restartAndCheckCcrStatus, selectCcrPreset, setupCcrConfiguration, showConfigurationTips, writeCcrConfig };
|