ccjk 12.0.0 → 12.0.2
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/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -30
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
|
@@ -1,37 +1,50 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
3
|
-
import inquirer from '
|
|
2
|
+
import a from './index2.mjs';
|
|
3
|
+
import { i as inquirer } from './index3.mjs';
|
|
4
4
|
import { resolveCodeToolType, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
|
|
5
|
-
import { ensureI18nInitialized, i18n } from './
|
|
5
|
+
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
6
6
|
import { readZcfConfig } from './ccjk-config.mjs';
|
|
7
7
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
8
8
|
import { s as switchCodexProvider, l as listCodexProviders, a as readCodexConfig, b as switchToOfficialLogin, c as switchToProvider } from './codex.mjs';
|
|
9
|
-
import { a as handleGeneralError } from '../shared/ccjk.
|
|
9
|
+
import { a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
|
|
10
10
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
11
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
12
|
+
import 'node:readline';
|
|
13
|
+
import 'stream';
|
|
14
|
+
import 'node:tty';
|
|
15
|
+
import 'node:async_hooks';
|
|
16
|
+
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
17
|
+
import 'node:util';
|
|
18
|
+
import 'tty';
|
|
19
|
+
import 'fs';
|
|
20
|
+
import 'child_process';
|
|
21
|
+
import 'node:path';
|
|
11
22
|
import 'node:os';
|
|
12
|
-
import '
|
|
23
|
+
import 'node:crypto';
|
|
24
|
+
import 'buffer';
|
|
25
|
+
import 'string_decoder';
|
|
26
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
13
27
|
import 'node:fs';
|
|
14
28
|
import 'node:url';
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import 'smol-toml';
|
|
29
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
30
|
+
import './index6.mjs';
|
|
18
31
|
import './fs-operations.mjs';
|
|
19
|
-
import 'node:crypto';
|
|
20
32
|
import 'node:fs/promises';
|
|
21
33
|
import './json-config.mjs';
|
|
22
|
-
import '
|
|
34
|
+
import '../shared/ccjk.RyizuzOI.mjs';
|
|
23
35
|
import './config.mjs';
|
|
24
36
|
import './claude-config.mjs';
|
|
25
37
|
import './platform.mjs';
|
|
26
|
-
import '
|
|
38
|
+
import './main.mjs';
|
|
39
|
+
import 'module';
|
|
40
|
+
import 'node:child_process';
|
|
41
|
+
import 'node:stream';
|
|
27
42
|
import '../shared/ccjk.BiCrMV5O.mjs';
|
|
28
|
-
import '
|
|
29
|
-
import '
|
|
43
|
+
import './index7.mjs';
|
|
44
|
+
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
30
45
|
import './prompts.mjs';
|
|
31
46
|
import './package.mjs';
|
|
32
|
-
import '../shared/ccjk.
|
|
33
|
-
import 'inquirer-toggle';
|
|
34
|
-
import 'node:child_process';
|
|
47
|
+
import '../shared/ccjk.DOwtZMk8.mjs';
|
|
35
48
|
|
|
36
49
|
async function configSwitchCommand(options) {
|
|
37
50
|
try {
|
|
@@ -78,23 +91,23 @@ async function listCodexProvidersWithDisplay() {
|
|
|
78
91
|
const currentProvider = existingConfig?.modelProvider;
|
|
79
92
|
const isCommented = existingConfig?.modelProviderCommented;
|
|
80
93
|
if (!providers || providers.length === 0) {
|
|
81
|
-
console.log(
|
|
94
|
+
console.log(a.yellow(i18n.t("codex:noProvidersAvailable")));
|
|
82
95
|
return;
|
|
83
96
|
}
|
|
84
|
-
console.log(
|
|
97
|
+
console.log(a.bold(i18n.t("codex:listProvidersTitle")));
|
|
85
98
|
console.log();
|
|
86
99
|
if (currentProvider && !isCommented) {
|
|
87
|
-
console.log(
|
|
100
|
+
console.log(a.green(i18n.t("codex:currentProvider", { provider: currentProvider })));
|
|
88
101
|
console.log();
|
|
89
102
|
}
|
|
90
103
|
providers.forEach((provider) => {
|
|
91
104
|
const isCurrent = currentProvider === provider.id && !isCommented;
|
|
92
|
-
const status = isCurrent ?
|
|
93
|
-
const current = isCurrent ?
|
|
94
|
-
console.log(`${status}${
|
|
95
|
-
console.log(` ${
|
|
105
|
+
const status = isCurrent ? a.green("\u25CF ") : " ";
|
|
106
|
+
const current = isCurrent ? a.yellow(` (${i18n.t("common:current")})`) : "";
|
|
107
|
+
console.log(`${status}${a.white(provider.name)}${current}`);
|
|
108
|
+
console.log(` ${a.green(`ID: ${provider.id}`)} ${a.gray(`(${provider.baseUrl})`)}`);
|
|
96
109
|
if (provider.tempEnvKey) {
|
|
97
|
-
console.log(` ${
|
|
110
|
+
console.log(` ${a.gray(`Env: ${provider.tempEnvKey}`)}`);
|
|
98
111
|
}
|
|
99
112
|
console.log();
|
|
100
113
|
});
|
|
@@ -102,18 +115,18 @@ async function listCodexProvidersWithDisplay() {
|
|
|
102
115
|
async function listClaudeCodeProfiles() {
|
|
103
116
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
104
117
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
105
|
-
console.log(
|
|
118
|
+
console.log(a.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
106
119
|
return;
|
|
107
120
|
}
|
|
108
|
-
console.log(
|
|
121
|
+
console.log(a.bold(i18n.t("multi-config:availableClaudeCodeProfiles")));
|
|
109
122
|
console.log();
|
|
110
123
|
const currentProfileId = config.currentProfileId;
|
|
111
124
|
Object.values(config.profiles).forEach((profile) => {
|
|
112
125
|
const isCurrent = profile.id === currentProfileId;
|
|
113
|
-
const status = isCurrent ?
|
|
114
|
-
const current = isCurrent ?
|
|
115
|
-
console.log(`${status}${
|
|
116
|
-
console.log(` ${
|
|
126
|
+
const status = isCurrent ? a.green("\u25CF ") : " ";
|
|
127
|
+
const current = isCurrent ? a.yellow(i18n.t("common:current")) : "";
|
|
128
|
+
console.log(`${status}${a.white(profile.name)}${current}`);
|
|
129
|
+
console.log(` ${a.green(`ID: ${profile.id}`)} ${a.gray(`(${profile.authType})`)}`);
|
|
117
130
|
console.log();
|
|
118
131
|
});
|
|
119
132
|
}
|
|
@@ -131,13 +144,13 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
131
144
|
if (result.success) {
|
|
132
145
|
try {
|
|
133
146
|
await ClaudeCodeConfigManager.applyProfileSettings(null);
|
|
134
|
-
console.log(
|
|
147
|
+
console.log(a.green(i18n.t("multi-config:successfullySwitchedToOfficial")));
|
|
135
148
|
} catch (error) {
|
|
136
149
|
const reason = error instanceof Error ? error.message : String(error);
|
|
137
|
-
console.log(
|
|
150
|
+
console.log(a.red(reason));
|
|
138
151
|
}
|
|
139
152
|
} else {
|
|
140
|
-
console.log(
|
|
153
|
+
console.log(a.red(i18n.t("multi-config:failedToSwitchToOfficial", { error: result.error })));
|
|
141
154
|
}
|
|
142
155
|
} else if (target === "ccr") {
|
|
143
156
|
const result = await ClaudeCodeConfigManager.switchToCcr();
|
|
@@ -145,18 +158,18 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
145
158
|
try {
|
|
146
159
|
const profile = ClaudeCodeConfigManager.getProfileById("ccr-proxy");
|
|
147
160
|
await ClaudeCodeConfigManager.applyProfileSettings(profile);
|
|
148
|
-
console.log(
|
|
161
|
+
console.log(a.green(i18n.t("multi-config:successfullySwitchedToCcr")));
|
|
149
162
|
} catch (error) {
|
|
150
163
|
const reason = error instanceof Error ? error.message : String(error);
|
|
151
|
-
console.log(
|
|
164
|
+
console.log(a.red(reason));
|
|
152
165
|
}
|
|
153
166
|
} else {
|
|
154
|
-
console.log(
|
|
167
|
+
console.log(a.red(i18n.t("multi-config:failedToSwitchToCcr", { error: result.error })));
|
|
155
168
|
}
|
|
156
169
|
} else {
|
|
157
170
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
158
171
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
159
|
-
console.log(
|
|
172
|
+
console.log(a.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
160
173
|
return;
|
|
161
174
|
}
|
|
162
175
|
const normalizedTarget = target.trim();
|
|
@@ -170,20 +183,20 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
170
183
|
}
|
|
171
184
|
}
|
|
172
185
|
if (!resolvedProfile) {
|
|
173
|
-
console.log(
|
|
186
|
+
console.log(a.red(i18n.t("multi-config:profileNameNotFound", { name: target })));
|
|
174
187
|
return;
|
|
175
188
|
}
|
|
176
189
|
const result = await ClaudeCodeConfigManager.switchProfile(resolvedId);
|
|
177
190
|
if (result.success) {
|
|
178
191
|
try {
|
|
179
192
|
await ClaudeCodeConfigManager.applyProfileSettings({ ...resolvedProfile, id: resolvedId });
|
|
180
|
-
console.log(
|
|
193
|
+
console.log(a.green(i18n.t("multi-config:successfullySwitchedToProfile", { name: resolvedProfile.name })));
|
|
181
194
|
} catch (error) {
|
|
182
195
|
const reason = error instanceof Error ? error.message : String(error);
|
|
183
|
-
console.log(
|
|
196
|
+
console.log(a.red(reason));
|
|
184
197
|
}
|
|
185
198
|
} else {
|
|
186
|
-
console.log(
|
|
199
|
+
console.log(a.red(i18n.t("multi-config:failedToSwitchToProfile", { error: result.error })));
|
|
187
200
|
}
|
|
188
201
|
}
|
|
189
202
|
}
|
|
@@ -198,7 +211,7 @@ async function handleInteractiveSwitch(codeType) {
|
|
|
198
211
|
async function handleClaudeCodeInteractiveSwitch() {
|
|
199
212
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
200
213
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
201
|
-
console.log(
|
|
214
|
+
console.log(a.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
202
215
|
return;
|
|
203
216
|
}
|
|
204
217
|
const currentProfileId = config.currentProfileId;
|
|
@@ -206,18 +219,18 @@ async function handleClaudeCodeInteractiveSwitch() {
|
|
|
206
219
|
const choices2 = [];
|
|
207
220
|
const isOfficialMode = !currentProfileId2 || currentProfileId2 === "official";
|
|
208
221
|
choices2.push({
|
|
209
|
-
name: isOfficialMode ? `${
|
|
222
|
+
name: isOfficialMode ? `${a.green("\u25CF ")}${i18n.t("codex:useOfficialLogin")} ${a.yellow(`(${i18n.t("common:current")})`)}` : ` ${i18n.t("codex:useOfficialLogin")}`,
|
|
210
223
|
value: "official"
|
|
211
224
|
});
|
|
212
225
|
const isCcrMode = currentProfileId2 === "ccr-proxy";
|
|
213
226
|
choices2.push({
|
|
214
|
-
name: isCcrMode ? `${
|
|
227
|
+
name: isCcrMode ? `${a.green("\u25CF ")}${i18n.t("multi-config:ccrProxyOption")} ${a.yellow(`(${i18n.t("common:current")})`)}` : ` ${i18n.t("multi-config:ccrProxyOption")}`,
|
|
215
228
|
value: "ccr"
|
|
216
229
|
});
|
|
217
230
|
Object.values(profiles).filter((profile) => profile.id !== "ccr-proxy").forEach((profile) => {
|
|
218
231
|
const isCurrent = profile.id === currentProfileId2;
|
|
219
232
|
choices2.push({
|
|
220
|
-
name: isCurrent ? `${
|
|
233
|
+
name: isCurrent ? `${a.green("\u25CF ")}${profile.name} ${a.yellow("(current)")}` : ` ${profile.name}`,
|
|
221
234
|
value: profile.id
|
|
222
235
|
});
|
|
223
236
|
});
|
|
@@ -232,13 +245,13 @@ async function handleClaudeCodeInteractiveSwitch() {
|
|
|
232
245
|
choices: addNumbersToChoices(choices)
|
|
233
246
|
}]);
|
|
234
247
|
if (!selectedConfig) {
|
|
235
|
-
console.log(
|
|
248
|
+
console.log(a.yellow(i18n.t("multi-config:cancelled")));
|
|
236
249
|
return;
|
|
237
250
|
}
|
|
238
251
|
await handleClaudeCodeDirectSwitch(selectedConfig);
|
|
239
252
|
} catch (error) {
|
|
240
253
|
if (error.name === "ExitPromptError") {
|
|
241
|
-
console.log(
|
|
254
|
+
console.log(a.green(`
|
|
242
255
|
${i18n.t("common:goodbye")}`));
|
|
243
256
|
return;
|
|
244
257
|
}
|
|
@@ -248,7 +261,7 @@ ${i18n.t("common:goodbye")}`));
|
|
|
248
261
|
async function handleCodexInteractiveSwitch() {
|
|
249
262
|
const providers = await listCodexProviders();
|
|
250
263
|
if (!providers || providers.length === 0) {
|
|
251
|
-
console.log(
|
|
264
|
+
console.log(a.yellow(i18n.t("codex:noProvidersAvailable")));
|
|
252
265
|
return;
|
|
253
266
|
}
|
|
254
267
|
const existingConfig = readCodexConfig();
|
|
@@ -258,13 +271,13 @@ async function handleCodexInteractiveSwitch() {
|
|
|
258
271
|
const choices2 = [];
|
|
259
272
|
const isOfficialMode = !currentProvider2 || isCommented2;
|
|
260
273
|
choices2.push({
|
|
261
|
-
name: isOfficialMode ? `${
|
|
274
|
+
name: isOfficialMode ? `${a.green("\u25CF ")}${i18n.t("codex:useOfficialLogin")} ${a.yellow("(\u5F53\u524D)")}` : ` ${i18n.t("codex:useOfficialLogin")}`,
|
|
262
275
|
value: "official"
|
|
263
276
|
});
|
|
264
277
|
providers2.forEach((provider) => {
|
|
265
278
|
const isCurrent = currentProvider2 === provider.id && !isCommented2;
|
|
266
279
|
choices2.push({
|
|
267
|
-
name: isCurrent ? `${
|
|
280
|
+
name: isCurrent ? `${a.green("\u25CF ")}${provider.name} - ${a.gray(provider.id)} ${a.yellow("(\u5F53\u524D)")}` : ` ${provider.name} - ${a.gray(provider.id)}`,
|
|
268
281
|
value: provider.id
|
|
269
282
|
});
|
|
270
283
|
});
|
|
@@ -279,7 +292,7 @@ async function handleCodexInteractiveSwitch() {
|
|
|
279
292
|
choices: addNumbersToChoices(choices)
|
|
280
293
|
}]);
|
|
281
294
|
if (!selectedConfig) {
|
|
282
|
-
console.log(
|
|
295
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
283
296
|
return;
|
|
284
297
|
}
|
|
285
298
|
let success = false;
|
|
@@ -289,11 +302,11 @@ async function handleCodexInteractiveSwitch() {
|
|
|
289
302
|
success = await switchToProvider(selectedConfig);
|
|
290
303
|
}
|
|
291
304
|
if (!success) {
|
|
292
|
-
console.log(
|
|
305
|
+
console.log(a.red(i18n.t("common:operationFailed")));
|
|
293
306
|
}
|
|
294
307
|
} catch (error) {
|
|
295
308
|
if (error.name === "ExitPromptError") {
|
|
296
|
-
console.log(
|
|
309
|
+
console.log(a.green(`
|
|
297
310
|
${i18n.t("common:goodbye")}`));
|
|
298
311
|
return;
|
|
299
312
|
}
|
package/dist/chunks/config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import
|
|
3
|
-
import dayjs from '
|
|
4
|
-
import inquirer from '
|
|
5
|
-
import { join, dirname } from 'pathe';
|
|
2
|
+
import a from './index2.mjs';
|
|
3
|
+
import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
4
|
+
import { i as inquirer } from './index3.mjs';
|
|
6
5
|
import { CLAUDE_DIR, SETTINGS_FILE, CLAUDE_VSC_CONFIG_FILE, AI_OUTPUT_LANGUAGES } from './constants.mjs';
|
|
7
|
-
import { ensureI18nInitialized, i18n } from './
|
|
6
|
+
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
8
7
|
import { s as setPrimaryApiKey, c as addCompletedOnboarding, d as deepMerge } from './claude-config.mjs';
|
|
9
8
|
import { exists, ensureDir, copyDir, writeFileAtomic, copyFile } from './fs-operations.mjs';
|
|
10
9
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
11
10
|
import { m as mergeAndCleanPermissions } from '../shared/ccjk.BiCrMV5O.mjs';
|
|
11
|
+
import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
12
12
|
|
|
13
13
|
const MODEL_ENV_KEYS = [
|
|
14
14
|
"ANTHROPIC_MODEL",
|
|
@@ -107,7 +107,7 @@ function configureApi(apiConfig) {
|
|
|
107
107
|
if (verification?.env) {
|
|
108
108
|
const envKey = apiConfig.authType === "api_key" ? "ANTHROPIC_API_KEY" : "ANTHROPIC_AUTH_TOKEN";
|
|
109
109
|
if (verification.env[envKey] !== apiConfig.key) {
|
|
110
|
-
console.error(
|
|
110
|
+
console.error(a.red("\u26A0 API config write verification failed \u2014 retrying..."));
|
|
111
111
|
const freshSettings = readJsonConfig(SETTINGS_FILE) || settings;
|
|
112
112
|
if (!freshSettings.env) freshSettings.env = {};
|
|
113
113
|
if (apiConfig.authType === "api_key") {
|
|
@@ -331,10 +331,10 @@ async function promptApiConfigurationAction() {
|
|
|
331
331
|
return null;
|
|
332
332
|
}
|
|
333
333
|
console.log(`
|
|
334
|
-
${
|
|
335
|
-
console.log(
|
|
336
|
-
console.log(
|
|
337
|
-
console.log(
|
|
334
|
+
${a.green(`\u2139 ${i18n.t("api:existingApiConfig")}`)}`);
|
|
335
|
+
console.log(a.gray(` ${i18n.t("api:apiConfigUrl")}: ${existingConfig.url || "N/A"}`));
|
|
336
|
+
console.log(a.gray(` ${i18n.t("api:apiConfigKey")}: ${existingConfig.key ? `***${existingConfig.key.slice(-4)}` : "N/A"}`));
|
|
337
|
+
console.log(a.gray(` ${i18n.t("api:apiConfigAuthType")}: ${existingConfig.authType || "N/A"}
|
|
338
338
|
`));
|
|
339
339
|
const { choice } = await inquirer.prompt({
|
|
340
340
|
type: "list",
|
package/dist/chunks/config2.mjs
CHANGED
|
@@ -3,26 +3,37 @@ import { existsSync, copyFileSync, mkdirSync } from 'node:fs';
|
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import process__default from 'node:process';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
|
-
import
|
|
7
|
-
import dayjs from '
|
|
8
|
-
import inquirer from '
|
|
9
|
-
import { join } from 'pathe';
|
|
6
|
+
import a from './index2.mjs';
|
|
7
|
+
import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
8
|
+
import { i as inquirer } from './index3.mjs';
|
|
10
9
|
import { SETTINGS_FILE } from './constants.mjs';
|
|
11
|
-
import { ensureI18nInitialized, i18n } from './
|
|
10
|
+
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
12
11
|
import { s as setPrimaryApiKey, c as addCompletedOnboarding } from './claude-config.mjs';
|
|
13
12
|
import { b as backupExistingConfig } from './config.mjs';
|
|
14
13
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
15
|
-
import { p as promptBoolean } from '../shared/ccjk.
|
|
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';
|
|
16
29
|
import 'node:url';
|
|
17
|
-
import 'i18next';
|
|
18
|
-
import 'i18next-fs-backend';
|
|
19
30
|
import './platform.mjs';
|
|
20
|
-
import '
|
|
31
|
+
import './main.mjs';
|
|
32
|
+
import 'module';
|
|
33
|
+
import 'node:stream';
|
|
21
34
|
import './fs-operations.mjs';
|
|
22
|
-
import 'node:crypto';
|
|
23
35
|
import 'node:fs/promises';
|
|
24
36
|
import '../shared/ccjk.BiCrMV5O.mjs';
|
|
25
|
-
import 'inquirer-toggle';
|
|
26
37
|
|
|
27
38
|
const PROVIDER_PRESETS_URL = "https://pub-0dc3e1677e894f07bbea11b17a29e032.r2.dev/providers.json";
|
|
28
39
|
async function fetchProviderPresets() {
|
|
@@ -190,12 +201,12 @@ async function backupCcrConfig() {
|
|
|
190
201
|
const timestamp = `${dayjs().format("YYYY-MM-DDTHH-mm-ss-SSS")}Z`;
|
|
191
202
|
const backupFileName = `config.json.${timestamp}.bak`;
|
|
192
203
|
const backupPath = join(CCR_BACKUP_DIR, backupFileName);
|
|
193
|
-
console.log(
|
|
204
|
+
console.log(a.green(`${i18n.t("ccr:backupCcrConfig")}`));
|
|
194
205
|
copyFileSync(CCR_CONFIG_FILE, backupPath);
|
|
195
|
-
console.log(
|
|
206
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrBackupSuccess").replace("{path}", backupPath)}`));
|
|
196
207
|
return backupPath;
|
|
197
208
|
} catch (error) {
|
|
198
|
-
console.error(
|
|
209
|
+
console.error(a.red(`${i18n.t("ccr:ccrBackupFailed")}:`), error.message);
|
|
199
210
|
return null;
|
|
200
211
|
}
|
|
201
212
|
}
|
|
@@ -230,10 +241,10 @@ async function configureCcrProxy(ccrConfig) {
|
|
|
230
241
|
}
|
|
231
242
|
async function selectCcrPreset() {
|
|
232
243
|
ensureI18nInitialized();
|
|
233
|
-
console.log(
|
|
244
|
+
console.log(a.green(`${i18n.t("ccr:fetchingPresets")}`));
|
|
234
245
|
const presets = await fetchProviderPresets();
|
|
235
246
|
if (!presets || presets.length === 0) {
|
|
236
|
-
console.log(
|
|
247
|
+
console.log(a.yellow(`${i18n.t("ccr:noPresetsAvailable")}`));
|
|
237
248
|
return null;
|
|
238
249
|
}
|
|
239
250
|
try {
|
|
@@ -256,7 +267,7 @@ async function selectCcrPreset() {
|
|
|
256
267
|
return preset;
|
|
257
268
|
} catch (error) {
|
|
258
269
|
if (error.name === "ExitPromptError") {
|
|
259
|
-
console.log(
|
|
270
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
260
271
|
return null;
|
|
261
272
|
}
|
|
262
273
|
throw error;
|
|
@@ -338,14 +349,14 @@ async function configureCcrWithPreset(preset) {
|
|
|
338
349
|
async function restartAndCheckCcrStatus() {
|
|
339
350
|
ensureI18nInitialized();
|
|
340
351
|
try {
|
|
341
|
-
console.log(
|
|
352
|
+
console.log(a.green(`${i18n.t("ccr:restartingCcr")}`));
|
|
342
353
|
await execAsync("ccr restart");
|
|
343
|
-
console.log(
|
|
344
|
-
console.log(
|
|
354
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrRestartSuccess")}`));
|
|
355
|
+
console.log(a.green(`${i18n.t("ccr:checkingCcrStatus")}`));
|
|
345
356
|
const { stdout } = await execAsync("ccr status");
|
|
346
|
-
console.log(
|
|
357
|
+
console.log(a.gray(stdout));
|
|
347
358
|
} catch (error) {
|
|
348
|
-
console.error(
|
|
359
|
+
console.error(a.red(`${i18n.t("ccr:ccrRestartFailed")}:`), error.message || error);
|
|
349
360
|
if (process__default.env.DEBUG) {
|
|
350
361
|
console.error("Full error:", error);
|
|
351
362
|
}
|
|
@@ -353,14 +364,14 @@ async function restartAndCheckCcrStatus() {
|
|
|
353
364
|
}
|
|
354
365
|
async function showConfigurationTips(apiKey) {
|
|
355
366
|
ensureI18nInitialized();
|
|
356
|
-
console.log(
|
|
367
|
+
console.log(a.bold.cyan(`
|
|
357
368
|
\u{1F4CC} ${i18n.t("ccr:configTips")}:`));
|
|
358
|
-
console.log(
|
|
359
|
-
console.log(
|
|
360
|
-
console.log(
|
|
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")}`));
|
|
361
372
|
if (apiKey) {
|
|
362
|
-
console.log(
|
|
363
|
-
console.log(
|
|
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"}`));
|
|
364
375
|
}
|
|
365
376
|
console.log("");
|
|
366
377
|
}
|
|
@@ -385,7 +396,7 @@ async function setupCcrConfiguration() {
|
|
|
385
396
|
try {
|
|
386
397
|
const existingConfig = readCcrConfig();
|
|
387
398
|
if (existingConfig) {
|
|
388
|
-
console.log(
|
|
399
|
+
console.log(a.green(`\u2139 ${i18n.t("ccr:existingCcrConfig")}`));
|
|
389
400
|
let shouldBackupAndReconfigure = false;
|
|
390
401
|
try {
|
|
391
402
|
shouldBackupAndReconfigure = await promptBoolean({
|
|
@@ -394,21 +405,21 @@ async function setupCcrConfiguration() {
|
|
|
394
405
|
});
|
|
395
406
|
} catch (error) {
|
|
396
407
|
if (error.name === "ExitPromptError") {
|
|
397
|
-
console.log(
|
|
408
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
398
409
|
return false;
|
|
399
410
|
}
|
|
400
411
|
throw error;
|
|
401
412
|
}
|
|
402
413
|
if (!shouldBackupAndReconfigure) {
|
|
403
|
-
console.log(
|
|
414
|
+
console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
|
|
404
415
|
await configureCcrProxy(existingConfig);
|
|
405
416
|
try {
|
|
406
417
|
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
|
|
407
418
|
const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
408
419
|
manageApiKeyApproval(apiKey);
|
|
409
|
-
console.log(
|
|
420
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
410
421
|
} catch (error) {
|
|
411
|
-
console.error(
|
|
422
|
+
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
|
412
423
|
}
|
|
413
424
|
return true;
|
|
414
425
|
}
|
|
@@ -420,37 +431,37 @@ async function setupCcrConfiguration() {
|
|
|
420
431
|
}
|
|
421
432
|
let config;
|
|
422
433
|
if (preset === "skip") {
|
|
423
|
-
console.log(
|
|
434
|
+
console.log(a.yellow(`${i18n.t("ccr:skipConfiguring")}`));
|
|
424
435
|
config = createDefaultCcrConfig();
|
|
425
436
|
} else {
|
|
426
437
|
config = await configureCcrWithPreset(preset);
|
|
427
438
|
}
|
|
428
439
|
writeCcrConfig(config);
|
|
429
|
-
console.log(
|
|
440
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
|
|
430
441
|
await configureCcrProxy(config);
|
|
431
|
-
console.log(
|
|
442
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
|
|
432
443
|
await restartAndCheckCcrStatus();
|
|
433
444
|
await showConfigurationTips(config.APIKEY);
|
|
434
445
|
try {
|
|
435
446
|
addCompletedOnboarding();
|
|
436
447
|
} catch (error) {
|
|
437
|
-
console.error(
|
|
448
|
+
console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
|
|
438
449
|
}
|
|
439
450
|
try {
|
|
440
451
|
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
|
|
441
452
|
const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
|
|
442
453
|
manageApiKeyApproval(apiKey);
|
|
443
|
-
console.log(
|
|
454
|
+
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
444
455
|
} catch (error) {
|
|
445
|
-
console.error(
|
|
456
|
+
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
|
446
457
|
}
|
|
447
458
|
return true;
|
|
448
459
|
} catch (error) {
|
|
449
460
|
if (error.name === "ExitPromptError") {
|
|
450
|
-
console.log(
|
|
461
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
451
462
|
return false;
|
|
452
463
|
}
|
|
453
|
-
console.error(
|
|
464
|
+
console.error(a.red(`${i18n.t("ccr:ccrConfigFailed")}:`), error);
|
|
454
465
|
return false;
|
|
455
466
|
}
|
|
456
467
|
}
|
|
@@ -458,7 +469,7 @@ async function configureCcrFeature() {
|
|
|
458
469
|
ensureI18nInitialized();
|
|
459
470
|
const backupDir = backupExistingConfig();
|
|
460
471
|
if (backupDir) {
|
|
461
|
-
console.log(
|
|
472
|
+
console.log(a.gray(`\u2714 ${i18n.t("configuration:backupSuccess")}: ${backupDir}`));
|
|
462
473
|
}
|
|
463
474
|
await setupCcrConfiguration();
|
|
464
475
|
}
|