ccjk 5.2.0 → 5.2.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/api.mjs +6 -6
- package/dist/chunks/auto-updater.mjs +80 -133
- package/dist/chunks/ccm.mjs +7 -7
- package/dist/chunks/ccr.mjs +7 -4
- package/dist/chunks/ccu.mjs +6 -6
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +38 -38
- package/dist/chunks/cloud-v5.mjs +1651 -0
- package/dist/chunks/codex.mjs +70 -70
- package/dist/chunks/commands.mjs +25 -25
- package/dist/chunks/commit.mjs +16 -16
- package/dist/chunks/config-consolidator.mjs +9 -9
- package/dist/chunks/config-switch.mjs +39 -39
- package/dist/chunks/config.mjs +5 -5
- package/dist/chunks/config2.mjs +85 -85
- package/dist/chunks/context.mjs +2 -2
- package/dist/chunks/doctor.mjs +31 -31
- package/dist/chunks/features.mjs +84 -83
- package/dist/chunks/help.mjs +116 -116
- package/dist/chunks/index4.mjs +46 -46
- package/dist/chunks/init.mjs +214 -191
- package/dist/chunks/interview.mjs +102 -102
- package/dist/chunks/manager.mjs +238 -0
- package/dist/chunks/marketplace.mjs +59 -59
- package/dist/chunks/mcp.mjs +82 -82
- package/dist/chunks/menu.mjs +441 -379
- package/dist/chunks/notification.mjs +112 -112
- package/dist/chunks/onboarding.mjs +7 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permission-manager.mjs +8 -8
- package/dist/chunks/plugin.mjs +100 -100
- package/dist/chunks/prompts.mjs +15 -15
- package/dist/chunks/providers.mjs +65 -65
- package/dist/chunks/session.mjs +83 -83
- package/dist/chunks/skills-sync.mjs +72 -72
- package/dist/chunks/skills.mjs +88 -88
- package/dist/chunks/team.mjs +6 -6
- package/dist/chunks/uninstall.mjs +35 -35
- package/dist/chunks/update.mjs +6 -6
- package/dist/chunks/upgrade-manager.mjs +4 -4
- package/dist/chunks/workflows2.mjs +13 -13
- package/dist/cli.mjs +21 -0
- package/dist/i18n/locales/en/menu.json +16 -1
- package/dist/i18n/locales/en/skills.json +29 -0
- package/dist/i18n/locales/zh-CN/menu.json +16 -1
- package/dist/i18n/locales/zh-CN/skills.json +29 -0
- package/dist/index.mjs +4 -4
- package/dist/shared/{ccjk.f40us0yY.mjs → ccjk.BiJujy5w.mjs} +4 -4
- package/dist/shared/{ccjk.CQzwtnZ1.mjs → ccjk.C_3BYaWc.mjs} +50 -50
- package/dist/shared/{ccjk.Zwx-YR_P.mjs → ccjk.DjD9Rzxq.mjs} +32 -32
- package/dist/shared/{ccjk.DtWIPt8E.mjs → ccjk.XgW1H2t3.mjs} +68 -68
- package/dist/shared/{ccjk.BlPCiSHj.mjs → ccjk.tI4PJA0c.mjs} +30 -30
- package/package.json +3 -3
package/dist/chunks/commit.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ansis__default from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { exec } from 'tinyexec';
|
|
4
4
|
|
|
@@ -62,26 +62,26 @@ async function commitChanges(message) {
|
|
|
62
62
|
|
|
63
63
|
async function commit(options = {}) {
|
|
64
64
|
if (!await checkGitRepo()) {
|
|
65
|
-
console.log(
|
|
65
|
+
console.log(ansis__default.red("\u2717 Not a git repository"));
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
const status = await getGitStatus();
|
|
69
69
|
if (!status.hasChanges) {
|
|
70
|
-
console.log(
|
|
70
|
+
console.log(ansis__default.yellow("No changes to commit"));
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
console.log(
|
|
73
|
+
console.log(ansis__default.green("\n\u{1F4DD} Changes detected:"));
|
|
74
74
|
if (status.staged.length > 0) {
|
|
75
|
-
console.log(
|
|
76
|
-
status.staged.forEach((f) => console.log(
|
|
75
|
+
console.log(ansis__default.green(` Staged: ${status.staged.length} files`));
|
|
76
|
+
status.staged.forEach((f) => console.log(ansis__default.gray(` ${f}`)));
|
|
77
77
|
}
|
|
78
78
|
if (status.unstaged.length > 0)
|
|
79
|
-
console.log(
|
|
79
|
+
console.log(ansis__default.yellow(` Unstaged: ${status.unstaged.length} files`));
|
|
80
80
|
if (status.untracked.length > 0)
|
|
81
|
-
console.log(
|
|
81
|
+
console.log(ansis__default.yellow(` Untracked: ${status.untracked.length} files`));
|
|
82
82
|
if (status.unstaged.length > 0 || status.untracked.length > 0) {
|
|
83
83
|
await stageAllChanges();
|
|
84
|
-
console.log(
|
|
84
|
+
console.log(ansis__default.green("\n\u2713 All changes staged"));
|
|
85
85
|
}
|
|
86
86
|
const allFiles = [...status.staged, ...status.unstaged, ...status.untracked];
|
|
87
87
|
let message;
|
|
@@ -89,8 +89,8 @@ async function commit(options = {}) {
|
|
|
89
89
|
message = options.message;
|
|
90
90
|
} else if (options.auto) {
|
|
91
91
|
message = await generateCommitMessage(allFiles);
|
|
92
|
-
console.log(
|
|
93
|
-
console.log(
|
|
92
|
+
console.log(ansis__default.green("\n\u{1F4AC} Generated commit message:"));
|
|
93
|
+
console.log(ansis__default.white(message));
|
|
94
94
|
} else {
|
|
95
95
|
const suggested = await generateCommitMessage(allFiles);
|
|
96
96
|
const { commitMessage } = await inquirer.prompt([{
|
|
@@ -102,16 +102,16 @@ async function commit(options = {}) {
|
|
|
102
102
|
message = commitMessage;
|
|
103
103
|
}
|
|
104
104
|
if (options.dryRun) {
|
|
105
|
-
console.log(
|
|
106
|
-
console.log(
|
|
107
|
-
console.log(
|
|
105
|
+
console.log(ansis__default.yellow("\n\u{1F50D} Dry run - no commit created"));
|
|
106
|
+
console.log(ansis__default.gray("Would commit with:"));
|
|
107
|
+
console.log(ansis__default.white(message));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
try {
|
|
111
111
|
await commitChanges(message);
|
|
112
|
-
console.log(
|
|
112
|
+
console.log(ansis__default.green("\n\u2713 Changes committed"));
|
|
113
113
|
} catch (error) {
|
|
114
|
-
console.log(
|
|
114
|
+
console.log(ansis__default.red(`
|
|
115
115
|
\u2717 Commit failed: ${error}`));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { existsSync, statSync, readFileSync, mkdirSync, copyFileSync, unlinkSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import process__default from 'node:process';
|
|
4
|
-
import
|
|
4
|
+
import ansis__default from 'ansis';
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
6
|
import { join } from 'pathe';
|
|
7
7
|
import { SETTINGS_FILE, ClAUDE_CONFIG_FILE, CLAUDE_VSC_CONFIG_FILE, CLAUDE_DIR, CCJK_CONFIG_DIR } from './constants.mjs';
|
|
8
|
-
import { S as STATUS } from '../shared/ccjk.
|
|
8
|
+
import { S as STATUS } from '../shared/ccjk.DjD9Rzxq.mjs';
|
|
9
9
|
import { writeFileAtomic } from './fs-operations.mjs';
|
|
10
10
|
import './index2.mjs';
|
|
11
11
|
import 'node:url';
|
|
@@ -240,7 +240,7 @@ function removeRedundantConfigs(configs, keepPath = SETTINGS_FILE) {
|
|
|
240
240
|
}
|
|
241
241
|
function displayConfigScan(configs) {
|
|
242
242
|
const existingConfigs = configs.filter((c) => c.exists);
|
|
243
|
-
console.log(
|
|
243
|
+
console.log(ansis__default.green("\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Config Files Detected \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n"));
|
|
244
244
|
if (existingConfigs.length === 0) {
|
|
245
245
|
console.log(STATUS.info("No config files found"));
|
|
246
246
|
return;
|
|
@@ -255,24 +255,24 @@ function displayConfigScan(configs) {
|
|
|
255
255
|
const typeLabel = config.type === "global" ? "primary" : config.type;
|
|
256
256
|
if (config.type === "global" && config.path === SETTINGS_FILE) {
|
|
257
257
|
console.log(STATUS.success(`${config.path}`));
|
|
258
|
-
console.log(
|
|
258
|
+
console.log(ansis__default.gray(` (${typeLabel}, ${sizeKB}KB, modified ${modified})`));
|
|
259
259
|
} else if (config.type === "legacy") {
|
|
260
260
|
console.log(STATUS.warning(`${config.path}`));
|
|
261
|
-
console.log(
|
|
261
|
+
console.log(ansis__default.gray(` (${typeLabel}, ${sizeKB}KB, modified ${modified})`));
|
|
262
262
|
} else {
|
|
263
263
|
console.log(STATUS.info(`${config.path}`));
|
|
264
|
-
console.log(
|
|
264
|
+
console.log(ansis__default.gray(` (${typeLabel}, ${sizeKB}KB, modified ${modified})`));
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
const conflicts = compareConfigs(configs);
|
|
268
268
|
if (conflicts.length > 0) {
|
|
269
|
-
console.log(
|
|
269
|
+
console.log(ansis__default.yellow(`
|
|
270
270
|
Conflicts found: ${conflicts.length}`));
|
|
271
271
|
for (const conflict of conflicts.slice(0, 5)) {
|
|
272
|
-
console.log(
|
|
272
|
+
console.log(ansis__default.yellow(` - ${conflict.key}: differs in ${conflict.files.length} files`));
|
|
273
273
|
}
|
|
274
274
|
if (conflicts.length > 5) {
|
|
275
|
-
console.log(
|
|
275
|
+
console.log(ansis__default.gray(` ... and ${conflicts.length - 5} more`));
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
console.log("");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
2
|
+
import ansis__default from 'ansis';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import { resolveCodeToolType, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
|
|
5
5
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
6
6
|
import { readZcfConfig } from './ccjk-config.mjs';
|
|
7
7
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
8
8
|
import { a as switchCodexProvider, l as listCodexProviders, r as readCodexConfig, b as switchToOfficialLogin, c as switchToProvider } from './codex.mjs';
|
|
9
|
-
import { h as handleGeneralError } from '../shared/ccjk.
|
|
9
|
+
import { h as handleGeneralError } from '../shared/ccjk.BiJujy5w.mjs';
|
|
10
10
|
import { a as addNumbersToChoices } from '../shared/ccjk.DhBeLRzf.mjs';
|
|
11
11
|
import 'node:os';
|
|
12
12
|
import 'pathe';
|
|
@@ -75,23 +75,23 @@ async function listCodexProvidersWithDisplay() {
|
|
|
75
75
|
const currentProvider = existingConfig?.modelProvider;
|
|
76
76
|
const isCommented = existingConfig?.modelProviderCommented;
|
|
77
77
|
if (!providers || providers.length === 0) {
|
|
78
|
-
console.log(
|
|
78
|
+
console.log(ansis__default.yellow(i18n.t("codex:noProvidersAvailable")));
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
console.log(
|
|
81
|
+
console.log(ansis__default.bold(i18n.t("codex:listProvidersTitle")));
|
|
82
82
|
console.log();
|
|
83
83
|
if (currentProvider && !isCommented) {
|
|
84
|
-
console.log(
|
|
84
|
+
console.log(ansis__default.green(i18n.t("codex:currentProvider", { provider: currentProvider })));
|
|
85
85
|
console.log();
|
|
86
86
|
}
|
|
87
87
|
providers.forEach((provider) => {
|
|
88
88
|
const isCurrent = currentProvider === provider.id && !isCommented;
|
|
89
|
-
const status = isCurrent ?
|
|
90
|
-
const current = isCurrent ?
|
|
91
|
-
console.log(`${status}${
|
|
92
|
-
console.log(` ${
|
|
89
|
+
const status = isCurrent ? ansis__default.green("\u25CF ") : " ";
|
|
90
|
+
const current = isCurrent ? ansis__default.yellow(` (${i18n.t("common:current")})`) : "";
|
|
91
|
+
console.log(`${status}${ansis__default.white(provider.name)}${current}`);
|
|
92
|
+
console.log(` ${ansis__default.green(`ID: ${provider.id}`)} ${ansis__default.gray(`(${provider.baseUrl})`)}`);
|
|
93
93
|
if (provider.tempEnvKey) {
|
|
94
|
-
console.log(` ${
|
|
94
|
+
console.log(` ${ansis__default.gray(`Env: ${provider.tempEnvKey}`)}`);
|
|
95
95
|
}
|
|
96
96
|
console.log();
|
|
97
97
|
});
|
|
@@ -99,18 +99,18 @@ async function listCodexProvidersWithDisplay() {
|
|
|
99
99
|
async function listClaudeCodeProfiles() {
|
|
100
100
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
101
101
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
102
|
-
console.log(
|
|
102
|
+
console.log(ansis__default.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
console.log(
|
|
105
|
+
console.log(ansis__default.bold(i18n.t("multi-config:availableClaudeCodeProfiles")));
|
|
106
106
|
console.log();
|
|
107
107
|
const currentProfileId = config.currentProfileId;
|
|
108
108
|
Object.values(config.profiles).forEach((profile) => {
|
|
109
109
|
const isCurrent = profile.id === currentProfileId;
|
|
110
|
-
const status = isCurrent ?
|
|
111
|
-
const current = isCurrent ?
|
|
112
|
-
console.log(`${status}${
|
|
113
|
-
console.log(` ${
|
|
110
|
+
const status = isCurrent ? ansis__default.green("\u25CF ") : " ";
|
|
111
|
+
const current = isCurrent ? ansis__default.yellow(i18n.t("common:current")) : "";
|
|
112
|
+
console.log(`${status}${ansis__default.white(profile.name)}${current}`);
|
|
113
|
+
console.log(` ${ansis__default.green(`ID: ${profile.id}`)} ${ansis__default.gray(`(${profile.authType})`)}`);
|
|
114
114
|
console.log();
|
|
115
115
|
});
|
|
116
116
|
}
|
|
@@ -128,13 +128,13 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
128
128
|
if (result.success) {
|
|
129
129
|
try {
|
|
130
130
|
await ClaudeCodeConfigManager.applyProfileSettings(null);
|
|
131
|
-
console.log(
|
|
131
|
+
console.log(ansis__default.green(i18n.t("multi-config:successfullySwitchedToOfficial")));
|
|
132
132
|
} catch (error) {
|
|
133
133
|
const reason = error instanceof Error ? error.message : String(error);
|
|
134
|
-
console.log(
|
|
134
|
+
console.log(ansis__default.red(reason));
|
|
135
135
|
}
|
|
136
136
|
} else {
|
|
137
|
-
console.log(
|
|
137
|
+
console.log(ansis__default.red(i18n.t("multi-config:failedToSwitchToOfficial", { error: result.error })));
|
|
138
138
|
}
|
|
139
139
|
} else if (target === "ccr") {
|
|
140
140
|
const result = await ClaudeCodeConfigManager.switchToCcr();
|
|
@@ -142,18 +142,18 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
142
142
|
try {
|
|
143
143
|
const profile = ClaudeCodeConfigManager.getProfileById("ccr-proxy");
|
|
144
144
|
await ClaudeCodeConfigManager.applyProfileSettings(profile);
|
|
145
|
-
console.log(
|
|
145
|
+
console.log(ansis__default.green(i18n.t("multi-config:successfullySwitchedToCcr")));
|
|
146
146
|
} catch (error) {
|
|
147
147
|
const reason = error instanceof Error ? error.message : String(error);
|
|
148
|
-
console.log(
|
|
148
|
+
console.log(ansis__default.red(reason));
|
|
149
149
|
}
|
|
150
150
|
} else {
|
|
151
|
-
console.log(
|
|
151
|
+
console.log(ansis__default.red(i18n.t("multi-config:failedToSwitchToCcr", { error: result.error })));
|
|
152
152
|
}
|
|
153
153
|
} else {
|
|
154
154
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
155
155
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
156
|
-
console.log(
|
|
156
|
+
console.log(ansis__default.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
const normalizedTarget = target.trim();
|
|
@@ -167,20 +167,20 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
if (!resolvedProfile) {
|
|
170
|
-
console.log(
|
|
170
|
+
console.log(ansis__default.red(i18n.t("multi-config:profileNameNotFound", { name: target })));
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const result = await ClaudeCodeConfigManager.switchProfile(resolvedId);
|
|
174
174
|
if (result.success) {
|
|
175
175
|
try {
|
|
176
176
|
await ClaudeCodeConfigManager.applyProfileSettings({ ...resolvedProfile, id: resolvedId });
|
|
177
|
-
console.log(
|
|
177
|
+
console.log(ansis__default.green(i18n.t("multi-config:successfullySwitchedToProfile", { name: resolvedProfile.name })));
|
|
178
178
|
} catch (error) {
|
|
179
179
|
const reason = error instanceof Error ? error.message : String(error);
|
|
180
|
-
console.log(
|
|
180
|
+
console.log(ansis__default.red(reason));
|
|
181
181
|
}
|
|
182
182
|
} else {
|
|
183
|
-
console.log(
|
|
183
|
+
console.log(ansis__default.red(i18n.t("multi-config:failedToSwitchToProfile", { error: result.error })));
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -195,7 +195,7 @@ async function handleInteractiveSwitch(codeType) {
|
|
|
195
195
|
async function handleClaudeCodeInteractiveSwitch() {
|
|
196
196
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
197
197
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
198
|
-
console.log(
|
|
198
|
+
console.log(ansis__default.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
const currentProfileId = config.currentProfileId;
|
|
@@ -203,18 +203,18 @@ async function handleClaudeCodeInteractiveSwitch() {
|
|
|
203
203
|
const choices2 = [];
|
|
204
204
|
const isOfficialMode = !currentProfileId2 || currentProfileId2 === "official";
|
|
205
205
|
choices2.push({
|
|
206
|
-
name: isOfficialMode ? `${
|
|
206
|
+
name: isOfficialMode ? `${ansis__default.green("\u25CF ")}${i18n.t("codex:useOfficialLogin")} ${ansis__default.yellow(`(${i18n.t("common:current")})`)}` : ` ${i18n.t("codex:useOfficialLogin")}`,
|
|
207
207
|
value: "official"
|
|
208
208
|
});
|
|
209
209
|
const isCcrMode = currentProfileId2 === "ccr-proxy";
|
|
210
210
|
choices2.push({
|
|
211
|
-
name: isCcrMode ? `${
|
|
211
|
+
name: isCcrMode ? `${ansis__default.green("\u25CF ")}${i18n.t("multi-config:ccrProxyOption")} ${ansis__default.yellow(`(${i18n.t("common:current")})`)}` : ` ${i18n.t("multi-config:ccrProxyOption")}`,
|
|
212
212
|
value: "ccr"
|
|
213
213
|
});
|
|
214
214
|
Object.values(profiles).filter((profile) => profile.id !== "ccr-proxy").forEach((profile) => {
|
|
215
215
|
const isCurrent = profile.id === currentProfileId2;
|
|
216
216
|
choices2.push({
|
|
217
|
-
name: isCurrent ? `${
|
|
217
|
+
name: isCurrent ? `${ansis__default.green("\u25CF ")}${profile.name} ${ansis__default.yellow("(current)")}` : ` ${profile.name}`,
|
|
218
218
|
value: profile.id
|
|
219
219
|
});
|
|
220
220
|
});
|
|
@@ -229,13 +229,13 @@ async function handleClaudeCodeInteractiveSwitch() {
|
|
|
229
229
|
choices: addNumbersToChoices(choices)
|
|
230
230
|
}]);
|
|
231
231
|
if (!selectedConfig) {
|
|
232
|
-
console.log(
|
|
232
|
+
console.log(ansis__default.yellow(i18n.t("multi-config:cancelled")));
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
235
|
await handleClaudeCodeDirectSwitch(selectedConfig);
|
|
236
236
|
} catch (error) {
|
|
237
237
|
if (error.name === "ExitPromptError") {
|
|
238
|
-
console.log(
|
|
238
|
+
console.log(ansis__default.green(`
|
|
239
239
|
${i18n.t("common:goodbye")}`));
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
@@ -245,7 +245,7 @@ ${i18n.t("common:goodbye")}`));
|
|
|
245
245
|
async function handleCodexInteractiveSwitch() {
|
|
246
246
|
const providers = await listCodexProviders();
|
|
247
247
|
if (!providers || providers.length === 0) {
|
|
248
|
-
console.log(
|
|
248
|
+
console.log(ansis__default.yellow(i18n.t("codex:noProvidersAvailable")));
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
const existingConfig = readCodexConfig();
|
|
@@ -255,13 +255,13 @@ async function handleCodexInteractiveSwitch() {
|
|
|
255
255
|
const choices2 = [];
|
|
256
256
|
const isOfficialMode = !currentProvider2 || isCommented2;
|
|
257
257
|
choices2.push({
|
|
258
|
-
name: isOfficialMode ? `${
|
|
258
|
+
name: isOfficialMode ? `${ansis__default.green("\u25CF ")}${i18n.t("codex:useOfficialLogin")} ${ansis__default.yellow("(\u5F53\u524D)")}` : ` ${i18n.t("codex:useOfficialLogin")}`,
|
|
259
259
|
value: "official"
|
|
260
260
|
});
|
|
261
261
|
providers2.forEach((provider) => {
|
|
262
262
|
const isCurrent = currentProvider2 === provider.id && !isCommented2;
|
|
263
263
|
choices2.push({
|
|
264
|
-
name: isCurrent ? `${
|
|
264
|
+
name: isCurrent ? `${ansis__default.green("\u25CF ")}${provider.name} - ${ansis__default.gray(provider.id)} ${ansis__default.yellow("(\u5F53\u524D)")}` : ` ${provider.name} - ${ansis__default.gray(provider.id)}`,
|
|
265
265
|
value: provider.id
|
|
266
266
|
});
|
|
267
267
|
});
|
|
@@ -276,7 +276,7 @@ async function handleCodexInteractiveSwitch() {
|
|
|
276
276
|
choices: addNumbersToChoices(choices)
|
|
277
277
|
}]);
|
|
278
278
|
if (!selectedConfig) {
|
|
279
|
-
console.log(
|
|
279
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
let success = false;
|
|
@@ -286,11 +286,11 @@ async function handleCodexInteractiveSwitch() {
|
|
|
286
286
|
success = await switchToProvider(selectedConfig);
|
|
287
287
|
}
|
|
288
288
|
if (!success) {
|
|
289
|
-
console.log(
|
|
289
|
+
console.log(ansis__default.red(i18n.t("common:operationFailed")));
|
|
290
290
|
}
|
|
291
291
|
} catch (error) {
|
|
292
292
|
if (error.name === "ExitPromptError") {
|
|
293
|
-
console.log(
|
|
293
|
+
console.log(ansis__default.green(`
|
|
294
294
|
${i18n.t("common:goodbye")}`));
|
|
295
295
|
return;
|
|
296
296
|
}
|
package/dist/chunks/config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import
|
|
2
|
+
import ansis__default from 'ansis';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
5
|
import { join, dirname } from 'pathe';
|
|
@@ -526,10 +526,10 @@ async function promptApiConfigurationAction() {
|
|
|
526
526
|
return null;
|
|
527
527
|
}
|
|
528
528
|
console.log(`
|
|
529
|
-
${
|
|
530
|
-
console.log(
|
|
531
|
-
console.log(
|
|
532
|
-
console.log(
|
|
529
|
+
${ansis__default.green(`\u2139 ${i18n.t("api:existingApiConfig")}`)}`);
|
|
530
|
+
console.log(ansis__default.gray(` ${i18n.t("api:apiConfigUrl")}: ${existingConfig.url || "N/A"}`));
|
|
531
|
+
console.log(ansis__default.gray(` ${i18n.t("api:apiConfigKey")}: ${existingConfig.key ? `***${existingConfig.key.slice(-4)}` : "N/A"}`));
|
|
532
|
+
console.log(ansis__default.gray(` ${i18n.t("api:apiConfigAuthType")}: ${existingConfig.authType || "N/A"}
|
|
533
533
|
`));
|
|
534
534
|
const { choice } = await inquirer.prompt({
|
|
535
535
|
type: "list",
|