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
package/dist/chunks/config3.mjs
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import process__default from 'node:process';
|
|
3
|
-
import
|
|
4
|
-
import inquirer from '
|
|
3
|
+
import a from './index2.mjs';
|
|
4
|
+
import { i as inquirer } from './index3.mjs';
|
|
5
5
|
import { getApiProviderPresets } from './api-providers.mjs';
|
|
6
6
|
import { SETTINGS_FILE } from './constants.mjs';
|
|
7
|
-
import { i18n } from './
|
|
7
|
+
import { i18n } from './index5.mjs';
|
|
8
8
|
import { b as backupExistingConfig } from './config.mjs';
|
|
9
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
10
|
+
import 'node:readline';
|
|
11
|
+
import 'stream';
|
|
12
|
+
import 'node:tty';
|
|
13
|
+
import 'node:async_hooks';
|
|
14
|
+
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
15
|
+
import 'node:util';
|
|
16
|
+
import 'tty';
|
|
17
|
+
import 'fs';
|
|
18
|
+
import 'child_process';
|
|
19
|
+
import 'node:path';
|
|
9
20
|
import 'node:os';
|
|
10
|
-
import '
|
|
21
|
+
import 'node:crypto';
|
|
22
|
+
import 'buffer';
|
|
23
|
+
import 'string_decoder';
|
|
24
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
11
25
|
import 'node:url';
|
|
12
|
-
import '
|
|
13
|
-
import 'i18next-fs-backend';
|
|
14
|
-
import 'dayjs';
|
|
26
|
+
import '../shared/ccjk.RyizuzOI.mjs';
|
|
15
27
|
import './claude-config.mjs';
|
|
16
28
|
import './json-config.mjs';
|
|
17
29
|
import './fs-operations.mjs';
|
|
18
|
-
import 'node:crypto';
|
|
19
30
|
import 'node:fs/promises';
|
|
20
31
|
import './platform.mjs';
|
|
21
|
-
import '
|
|
32
|
+
import './main.mjs';
|
|
33
|
+
import 'module';
|
|
34
|
+
import 'node:child_process';
|
|
35
|
+
import 'node:stream';
|
|
22
36
|
import '../shared/ccjk.BiCrMV5O.mjs';
|
|
23
37
|
|
|
24
38
|
async function getConfig(key, options = {}) {
|
|
@@ -26,14 +40,14 @@ async function getConfig(key, options = {}) {
|
|
|
26
40
|
try {
|
|
27
41
|
const config = readClaudeConfig();
|
|
28
42
|
if (!config) {
|
|
29
|
-
console.log(
|
|
30
|
-
console.log(
|
|
43
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
44
|
+
console.log(a.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
31
45
|
console.log("");
|
|
32
46
|
return;
|
|
33
47
|
}
|
|
34
48
|
const value = getNestedValue(config, key);
|
|
35
49
|
if (value === void 0) {
|
|
36
|
-
console.log(
|
|
50
|
+
console.log(a.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" not found`));
|
|
37
51
|
console.log("");
|
|
38
52
|
return;
|
|
39
53
|
}
|
|
@@ -41,16 +55,16 @@ async function getConfig(key, options = {}) {
|
|
|
41
55
|
console.log(JSON.stringify(value, null, 2));
|
|
42
56
|
} else {
|
|
43
57
|
console.log("");
|
|
44
|
-
console.log(
|
|
45
|
-
console.log(
|
|
58
|
+
console.log(a.bold.cyan(isZh ? `\u{1F4CB} \u914D\u7F6E\u9879: ${key}` : `\u{1F4CB} Configuration: ${key}`));
|
|
59
|
+
console.log(a.dim("\u2500".repeat(60)));
|
|
46
60
|
console.log("");
|
|
47
61
|
displayValue(value, 0);
|
|
48
62
|
console.log("");
|
|
49
63
|
}
|
|
50
64
|
} catch (error) {
|
|
51
|
-
console.error(
|
|
65
|
+
console.error(a.red(isZh ? "\u274C \u8BFB\u53D6\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to read configuration"));
|
|
52
66
|
if (error instanceof Error) {
|
|
53
|
-
console.error(
|
|
67
|
+
console.error(a.dim(error.message));
|
|
54
68
|
}
|
|
55
69
|
console.log("");
|
|
56
70
|
}
|
|
@@ -60,14 +74,14 @@ async function setConfig(key, value, _options = {}) {
|
|
|
60
74
|
try {
|
|
61
75
|
const config = readClaudeConfig();
|
|
62
76
|
if (!config) {
|
|
63
|
-
console.log(
|
|
64
|
-
console.log(
|
|
77
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
78
|
+
console.log(a.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
65
79
|
console.log("");
|
|
66
80
|
return;
|
|
67
81
|
}
|
|
68
82
|
const backupPath = backupExistingConfig();
|
|
69
83
|
if (backupPath) {
|
|
70
|
-
console.log(
|
|
84
|
+
console.log(a.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
71
85
|
}
|
|
72
86
|
let parsedValue = value;
|
|
73
87
|
try {
|
|
@@ -77,15 +91,15 @@ async function setConfig(key, value, _options = {}) {
|
|
|
77
91
|
setNestedValue(config, key, parsedValue);
|
|
78
92
|
writeClaudeConfig(config);
|
|
79
93
|
console.log("");
|
|
80
|
-
console.log(
|
|
94
|
+
console.log(a.green(isZh ? `\u2705 \u914D\u7F6E\u9879 "${key}" \u5DF2\u66F4\u65B0` : `\u2705 Configuration "${key}" updated`));
|
|
81
95
|
console.log("");
|
|
82
|
-
console.log(
|
|
96
|
+
console.log(a.bold(isZh ? "\u65B0\u503C:" : "New value:"));
|
|
83
97
|
displayValue(parsedValue, 0);
|
|
84
98
|
console.log("");
|
|
85
99
|
} catch (error) {
|
|
86
|
-
console.error(
|
|
100
|
+
console.error(a.red(isZh ? "\u274C \u8BBE\u7F6E\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to set configuration"));
|
|
87
101
|
if (error instanceof Error) {
|
|
88
|
-
console.error(
|
|
102
|
+
console.error(a.dim(error.message));
|
|
89
103
|
}
|
|
90
104
|
console.log("");
|
|
91
105
|
}
|
|
@@ -95,8 +109,8 @@ async function listConfig(options = {}) {
|
|
|
95
109
|
try {
|
|
96
110
|
const config = readClaudeConfig();
|
|
97
111
|
if (!config) {
|
|
98
|
-
console.log(
|
|
99
|
-
console.log(
|
|
112
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
113
|
+
console.log(a.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
100
114
|
console.log("");
|
|
101
115
|
return;
|
|
102
116
|
}
|
|
@@ -105,8 +119,8 @@ async function listConfig(options = {}) {
|
|
|
105
119
|
return;
|
|
106
120
|
}
|
|
107
121
|
console.log("");
|
|
108
|
-
console.log(
|
|
109
|
-
console.log(
|
|
122
|
+
console.log(a.bold.cyan(isZh ? "\u{1F4CB} Claude Code \u914D\u7F6E" : "\u{1F4CB} Claude Code Configuration"));
|
|
123
|
+
console.log(a.dim("\u2500".repeat(60)));
|
|
110
124
|
console.log("");
|
|
111
125
|
displayConfigSection(isZh ? "API \u914D\u7F6E" : "API Configuration", {
|
|
112
126
|
baseUrl: config.baseUrl,
|
|
@@ -128,13 +142,13 @@ async function listConfig(options = {}) {
|
|
|
128
142
|
}, isZh);
|
|
129
143
|
}
|
|
130
144
|
console.log("");
|
|
131
|
-
console.log(
|
|
132
|
-
console.log(
|
|
145
|
+
console.log(a.dim("\u2500".repeat(60)));
|
|
146
|
+
console.log(a.dim(isZh ? `\u914D\u7F6E\u6587\u4EF6: ${SETTINGS_FILE}` : `Config file: ${SETTINGS_FILE}`));
|
|
133
147
|
console.log("");
|
|
134
148
|
} catch (error) {
|
|
135
|
-
console.error(
|
|
149
|
+
console.error(a.red(isZh ? "\u274C \u8BFB\u53D6\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to read configuration"));
|
|
136
150
|
if (error instanceof Error) {
|
|
137
|
-
console.error(
|
|
151
|
+
console.error(a.dim(error.message));
|
|
138
152
|
}
|
|
139
153
|
console.log("");
|
|
140
154
|
}
|
|
@@ -144,7 +158,7 @@ async function resetConfig(_options = {}) {
|
|
|
144
158
|
try {
|
|
145
159
|
const config = readClaudeConfig();
|
|
146
160
|
if (!config) {
|
|
147
|
-
console.log(
|
|
161
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
148
162
|
console.log("");
|
|
149
163
|
return;
|
|
150
164
|
}
|
|
@@ -155,26 +169,26 @@ async function resetConfig(_options = {}) {
|
|
|
155
169
|
default: false
|
|
156
170
|
});
|
|
157
171
|
if (!confirm) {
|
|
158
|
-
console.log(
|
|
172
|
+
console.log(a.yellow(isZh ? "\u5DF2\u53D6\u6D88" : "Cancelled"));
|
|
159
173
|
console.log("");
|
|
160
174
|
return;
|
|
161
175
|
}
|
|
162
176
|
const backupPath = backupExistingConfig();
|
|
163
177
|
if (backupPath) {
|
|
164
|
-
console.log(
|
|
178
|
+
console.log(a.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
165
179
|
}
|
|
166
180
|
const minimalConfig = {
|
|
167
181
|
completedOnboarding: true
|
|
168
182
|
};
|
|
169
183
|
writeClaudeConfig(minimalConfig);
|
|
170
184
|
console.log("");
|
|
171
|
-
console.log(
|
|
172
|
-
console.log(
|
|
185
|
+
console.log(a.green(isZh ? "\u2705 \u914D\u7F6E\u5DF2\u91CD\u7F6E" : "\u2705 Configuration reset"));
|
|
186
|
+
console.log(a.dim(isZh ? '\u8FD0\u884C "ccjk init" \u91CD\u65B0\u914D\u7F6E' : 'Run "ccjk init" to reconfigure'));
|
|
173
187
|
console.log("");
|
|
174
188
|
} catch (error) {
|
|
175
|
-
console.error(
|
|
189
|
+
console.error(a.red(isZh ? "\u274C \u91CD\u7F6E\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to reset configuration"));
|
|
176
190
|
if (error instanceof Error) {
|
|
177
|
-
console.error(
|
|
191
|
+
console.error(a.dim(error.message));
|
|
178
192
|
}
|
|
179
193
|
console.log("");
|
|
180
194
|
}
|
|
@@ -186,9 +200,9 @@ async function setProvider(providerId, options = {}) {
|
|
|
186
200
|
const providers = await getApiProviderPresets(codeType);
|
|
187
201
|
const provider = providers.find((p) => p.id === providerId);
|
|
188
202
|
if (!provider) {
|
|
189
|
-
console.log(
|
|
203
|
+
console.log(a.yellow(isZh ? `\u26A0\uFE0F \u4F9B\u5E94\u5546 "${providerId}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Provider "${providerId}" not found`));
|
|
190
204
|
console.log("");
|
|
191
|
-
console.log(
|
|
205
|
+
console.log(a.dim(isZh ? "\u53EF\u7528\u7684\u4F9B\u5E94\u5546:" : "Available providers:"));
|
|
192
206
|
for (const p of providers) {
|
|
193
207
|
console.log(` - ${p.id} (${p.name})`);
|
|
194
208
|
}
|
|
@@ -197,14 +211,14 @@ async function setProvider(providerId, options = {}) {
|
|
|
197
211
|
}
|
|
198
212
|
const config = readClaudeConfig();
|
|
199
213
|
if (!config) {
|
|
200
|
-
console.log(
|
|
201
|
-
console.log(
|
|
214
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
215
|
+
console.log(a.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
202
216
|
console.log("");
|
|
203
217
|
return;
|
|
204
218
|
}
|
|
205
219
|
const backupPath = backupExistingConfig();
|
|
206
220
|
if (backupPath) {
|
|
207
|
-
console.log(
|
|
221
|
+
console.log(a.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
208
222
|
}
|
|
209
223
|
if (codeType === "claude-code" && provider.claudeCode) {
|
|
210
224
|
config.baseUrl = provider.claudeCode.baseUrl;
|
|
@@ -217,24 +231,24 @@ async function setProvider(providerId, options = {}) {
|
|
|
217
231
|
}
|
|
218
232
|
writeClaudeConfig(config);
|
|
219
233
|
console.log("");
|
|
220
|
-
console.log(
|
|
234
|
+
console.log(a.green(isZh ? `\u2705 \u5DF2\u5207\u6362\u5230\u4F9B\u5E94\u5546: ${provider.name}` : `\u2705 Switched to provider: ${provider.name}`));
|
|
221
235
|
console.log("");
|
|
222
|
-
console.log(
|
|
223
|
-
console.log(` ${
|
|
224
|
-
console.log(` ${
|
|
236
|
+
console.log(a.bold(isZh ? "\u914D\u7F6E\u8BE6\u60C5:" : "Configuration details:"));
|
|
237
|
+
console.log(` ${a.green(isZh ? "\u4F9B\u5E94\u5546" : "Provider")}: ${provider.name}`);
|
|
238
|
+
console.log(` ${a.green(isZh ? "\u63A5\u53E3\u5730\u5740" : "Base URL")}: ${config.baseUrl}`);
|
|
225
239
|
if (config.model) {
|
|
226
|
-
console.log(` ${
|
|
240
|
+
console.log(` ${a.green(isZh ? "\u4E3B\u6A21\u578B" : "Primary Model")}: ${config.model}`);
|
|
227
241
|
}
|
|
228
242
|
if (config.fastModel) {
|
|
229
|
-
console.log(` ${
|
|
243
|
+
console.log(` ${a.green(isZh ? "\u5FEB\u901F\u6A21\u578B" : "Fast Model")}: ${config.fastModel}`);
|
|
230
244
|
}
|
|
231
245
|
console.log("");
|
|
232
|
-
console.log(
|
|
246
|
+
console.log(a.dim(isZh ? "\u{1F4A1} \u63D0\u793A: \u8BF7\u786E\u4FDD\u5DF2\u8BBE\u7F6E\u6B63\u786E\u7684 API \u5BC6\u94A5\u6216\u8BA4\u8BC1\u4EE4\u724C" : "\u{1F4A1} Tip: Make sure to set the correct API key or auth token"));
|
|
233
247
|
console.log("");
|
|
234
248
|
} catch (error) {
|
|
235
|
-
console.error(
|
|
249
|
+
console.error(a.red(isZh ? "\u274C \u8BBE\u7F6E\u4F9B\u5E94\u5546\u5931\u8D25" : "\u274C Failed to set provider"));
|
|
236
250
|
if (error instanceof Error) {
|
|
237
|
-
console.error(
|
|
251
|
+
console.error(a.dim(error.message));
|
|
238
252
|
}
|
|
239
253
|
console.log("");
|
|
240
254
|
}
|
|
@@ -244,8 +258,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
244
258
|
case "get":
|
|
245
259
|
if (args.length === 0) {
|
|
246
260
|
const isZh = i18n.language === "zh-CN";
|
|
247
|
-
console.log(
|
|
248
|
-
console.log(
|
|
261
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879" : "\u26A0\uFE0F Please specify a configuration key"));
|
|
262
|
+
console.log(a.dim(isZh ? "\u7528\u6CD5: ccjk config get <key>" : "Usage: ccjk config get <key>"));
|
|
249
263
|
console.log("");
|
|
250
264
|
return;
|
|
251
265
|
}
|
|
@@ -254,8 +268,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
254
268
|
case "set":
|
|
255
269
|
if (args.length < 2) {
|
|
256
270
|
const isZh = i18n.language === "zh-CN";
|
|
257
|
-
console.log(
|
|
258
|
-
console.log(
|
|
271
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879\u548C\u503C" : "\u26A0\uFE0F Please specify key and value"));
|
|
272
|
+
console.log(a.dim(isZh ? "\u7528\u6CD5: ccjk config set <key> <value>" : "Usage: ccjk config set <key> <value>"));
|
|
259
273
|
console.log("");
|
|
260
274
|
return;
|
|
261
275
|
}
|
|
@@ -271,8 +285,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
271
285
|
case "provider":
|
|
272
286
|
if (args.length === 0) {
|
|
273
287
|
const isZh = i18n.language === "zh-CN";
|
|
274
|
-
console.log(
|
|
275
|
-
console.log(
|
|
288
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u4F9B\u5E94\u5546 ID" : "\u26A0\uFE0F Please specify provider ID"));
|
|
289
|
+
console.log(a.dim(isZh ? "\u7528\u6CD5: ccjk config provider <id>" : "Usage: ccjk config provider <id>"));
|
|
276
290
|
console.log("");
|
|
277
291
|
return;
|
|
278
292
|
}
|
|
@@ -281,22 +295,22 @@ async function configCommand(action, args, options = {}) {
|
|
|
281
295
|
default: {
|
|
282
296
|
const isZh = i18n.language === "zh-CN";
|
|
283
297
|
console.log("");
|
|
284
|
-
console.log(
|
|
298
|
+
console.log(a.bold.cyan(isZh ? "\u2699\uFE0F \u914D\u7F6E\u7BA1\u7406\u547D\u4EE4" : "\u2699\uFE0F Configuration Management Commands"));
|
|
285
299
|
console.log("");
|
|
286
|
-
console.log(` ${
|
|
287
|
-
console.log(` ${
|
|
288
|
-
console.log(` ${
|
|
289
|
-
console.log(` ${
|
|
290
|
-
console.log(` ${
|
|
300
|
+
console.log(` ${a.green("ccjk config get <key>")} ${isZh ? "\u83B7\u53D6\u914D\u7F6E\u9879" : "Get configuration value"}`);
|
|
301
|
+
console.log(` ${a.green("ccjk config set <key> <value>")} ${isZh ? "\u8BBE\u7F6E\u914D\u7F6E\u9879" : "Set configuration value"}`);
|
|
302
|
+
console.log(` ${a.green("ccjk config list")} ${isZh ? "\u5217\u51FA\u6240\u6709\u914D\u7F6E" : "List all configuration"}`);
|
|
303
|
+
console.log(` ${a.green("ccjk config reset")} ${isZh ? "\u91CD\u7F6E\u914D\u7F6E" : "Reset configuration"}`);
|
|
304
|
+
console.log(` ${a.green("ccjk config provider <id>")} ${isZh ? "\u5207\u6362\u4F9B\u5E94\u5546" : "Switch provider"}`);
|
|
291
305
|
console.log("");
|
|
292
|
-
console.log(
|
|
293
|
-
console.log(` ${
|
|
294
|
-
console.log(` ${
|
|
306
|
+
console.log(a.bold(isZh ? "\u9009\u9879" : "Options"));
|
|
307
|
+
console.log(` ${a.green("--code-type, -T")} <type> ${isZh ? "\u4EE3\u7801\u5DE5\u5177\u7C7B\u578B (claude-code, codex)" : "Code tool type (claude-code, codex)"}`);
|
|
308
|
+
console.log(` ${a.green("--json, -j")} ${isZh ? "JSON \u683C\u5F0F\u8F93\u51FA" : "JSON format output"}`);
|
|
295
309
|
console.log("");
|
|
296
|
-
console.log(
|
|
297
|
-
console.log(` ${
|
|
298
|
-
console.log(` ${
|
|
299
|
-
console.log(` ${
|
|
310
|
+
console.log(a.bold(isZh ? "\u793A\u4F8B" : "Examples"));
|
|
311
|
+
console.log(` ${a.dim("ccjk config get baseUrl")}`);
|
|
312
|
+
console.log(` ${a.dim('ccjk config set model "claude-3-5-sonnet-20241022"')}`);
|
|
313
|
+
console.log(` ${a.dim("ccjk config provider glm")}`);
|
|
300
314
|
console.log("");
|
|
301
315
|
}
|
|
302
316
|
}
|
|
@@ -344,22 +358,22 @@ function setNestedValue(obj, path, value) {
|
|
|
344
358
|
function displayValue(value, indent) {
|
|
345
359
|
const prefix = " ".repeat(indent);
|
|
346
360
|
if (value === null) {
|
|
347
|
-
console.log(`${prefix}${
|
|
361
|
+
console.log(`${prefix}${a.dim("null")}`);
|
|
348
362
|
} else if (typeof value === "boolean") {
|
|
349
|
-
console.log(`${prefix}${
|
|
363
|
+
console.log(`${prefix}${a.green(value.toString())}`);
|
|
350
364
|
} else if (typeof value === "number") {
|
|
351
|
-
console.log(`${prefix}${
|
|
365
|
+
console.log(`${prefix}${a.yellow(value.toString())}`);
|
|
352
366
|
} else if (typeof value === "string") {
|
|
353
|
-
console.log(`${prefix}${
|
|
367
|
+
console.log(`${prefix}${a.green(value)}`);
|
|
354
368
|
} else if (Array.isArray(value)) {
|
|
355
|
-
console.log(`${prefix}${
|
|
369
|
+
console.log(`${prefix}${a.dim("[")}`);
|
|
356
370
|
for (const item of value) {
|
|
357
371
|
displayValue(item, indent + 1);
|
|
358
372
|
}
|
|
359
|
-
console.log(`${prefix}${
|
|
373
|
+
console.log(`${prefix}${a.dim("]")}`);
|
|
360
374
|
} else if (typeof value === "object") {
|
|
361
375
|
for (const [key, val] of Object.entries(value)) {
|
|
362
|
-
console.log(`${prefix}${
|
|
376
|
+
console.log(`${prefix}${a.bold(key)}:`);
|
|
363
377
|
displayValue(val, indent + 1);
|
|
364
378
|
}
|
|
365
379
|
} else {
|
|
@@ -367,14 +381,14 @@ function displayValue(value, indent) {
|
|
|
367
381
|
}
|
|
368
382
|
}
|
|
369
383
|
function displayConfigSection(title, data, _isZh) {
|
|
370
|
-
console.log(
|
|
384
|
+
console.log(a.bold(title));
|
|
371
385
|
console.log("");
|
|
372
386
|
for (const [key, value] of Object.entries(data)) {
|
|
373
387
|
if (value !== void 0) {
|
|
374
388
|
if (Array.isArray(value)) {
|
|
375
|
-
console.log(` ${
|
|
389
|
+
console.log(` ${a.green(key)}: ${value.join(", ")}`);
|
|
376
390
|
} else {
|
|
377
|
-
console.log(` ${
|
|
391
|
+
console.log(` ${a.green(key)}: ${value}`);
|
|
378
392
|
}
|
|
379
393
|
}
|
|
380
394
|
}
|
|
@@ -383,7 +397,7 @@ function displayConfigSection(title, data, _isZh) {
|
|
|
383
397
|
async function unsetConfig(key, _options = {}) {
|
|
384
398
|
const isZh = i18n.language === "zh-CN";
|
|
385
399
|
if (!key) {
|
|
386
|
-
console.log(
|
|
400
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879" : "\u26A0\uFE0F Please specify a configuration key"));
|
|
387
401
|
return;
|
|
388
402
|
}
|
|
389
403
|
const config = readClaudeConfig();
|
|
@@ -391,36 +405,36 @@ async function unsetConfig(key, _options = {}) {
|
|
|
391
405
|
let current = config;
|
|
392
406
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
393
407
|
if (current[keys[i]] === void 0) {
|
|
394
|
-
console.log(
|
|
408
|
+
console.log(a.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" does not exist`));
|
|
395
409
|
return;
|
|
396
410
|
}
|
|
397
411
|
current = current[keys[i]];
|
|
398
412
|
}
|
|
399
413
|
const lastKey = keys[keys.length - 1];
|
|
400
414
|
if (current[lastKey] === void 0) {
|
|
401
|
-
console.log(
|
|
415
|
+
console.log(a.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" does not exist`));
|
|
402
416
|
return;
|
|
403
417
|
}
|
|
404
418
|
delete current[lastKey];
|
|
405
419
|
writeClaudeConfig(config);
|
|
406
|
-
console.log(
|
|
420
|
+
console.log(a.green(isZh ? `\u2705 \u5DF2\u5220\u9664\u914D\u7F6E\u9879: ${key}` : `\u2705 Removed configuration: ${key}`));
|
|
407
421
|
}
|
|
408
422
|
async function editConfig(_options = {}) {
|
|
409
423
|
const isZh = i18n.language === "zh-CN";
|
|
410
424
|
const configPath = getClaudeConfigPath();
|
|
411
425
|
const editor = process__default.env.EDITOR || process__default.env.VISUAL || "vi";
|
|
412
|
-
console.log(
|
|
426
|
+
console.log(a.green(isZh ? `\u{1F4DD} \u6B63\u5728\u6253\u5F00\u914D\u7F6E\u6587\u4EF6: ${configPath}` : `\u{1F4DD} Opening config file: ${configPath}`));
|
|
413
427
|
const { spawn } = await import('node:child_process');
|
|
414
428
|
const child = spawn(editor, [configPath], { stdio: "inherit" });
|
|
415
429
|
child.on("exit", (code) => {
|
|
416
430
|
if (code === 0) {
|
|
417
|
-
console.log(
|
|
431
|
+
console.log(a.green(isZh ? "\u2705 \u914D\u7F6E\u6587\u4EF6\u5DF2\u4FDD\u5B58" : "\u2705 Config file saved"));
|
|
418
432
|
}
|
|
419
433
|
});
|
|
420
434
|
}
|
|
421
435
|
async function validateConfig(_options = {}) {
|
|
422
436
|
const isZh = i18n.language === "zh-CN";
|
|
423
|
-
console.log(
|
|
437
|
+
console.log(a.green(isZh ? "\u{1F50D} \u6B63\u5728\u9A8C\u8BC1\u914D\u7F6E..." : "\u{1F50D} Validating configuration..."));
|
|
424
438
|
console.log("");
|
|
425
439
|
const config = readClaudeConfig();
|
|
426
440
|
const errors = [];
|
|
@@ -435,19 +449,19 @@ async function validateConfig(_options = {}) {
|
|
|
435
449
|
errors.push(isZh ? "model \u683C\u5F0F\u65E0\u6548" : "model format is invalid");
|
|
436
450
|
}
|
|
437
451
|
if (errors.length === 0 && warnings.length === 0) {
|
|
438
|
-
console.log(
|
|
452
|
+
console.log(a.green(isZh ? "\u2705 \u914D\u7F6E\u9A8C\u8BC1\u901A\u8FC7" : "\u2705 Configuration is valid"));
|
|
439
453
|
} else {
|
|
440
454
|
if (errors.length > 0) {
|
|
441
|
-
console.log(
|
|
455
|
+
console.log(a.red(isZh ? "\u274C \u9519\u8BEF:" : "\u274C Errors:"));
|
|
442
456
|
for (const error of errors) {
|
|
443
|
-
console.log(
|
|
457
|
+
console.log(a.red(` \u2022 ${error}`));
|
|
444
458
|
}
|
|
445
459
|
console.log("");
|
|
446
460
|
}
|
|
447
461
|
if (warnings.length > 0) {
|
|
448
|
-
console.log(
|
|
462
|
+
console.log(a.yellow(isZh ? "\u26A0\uFE0F \u8B66\u544A:" : "\u26A0\uFE0F Warnings:"));
|
|
449
463
|
for (const warning of warnings) {
|
|
450
|
-
console.log(
|
|
464
|
+
console.log(a.yellow(` \u2022 ${warning}`));
|
|
451
465
|
}
|
|
452
466
|
}
|
|
453
467
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { i18n } from './index5.mjs';
|
|
3
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:process';
|
|
6
6
|
import 'node:url';
|
|
7
|
-
import 'i18next';
|
|
8
|
-
import 'i18next-fs-backend';
|
|
9
7
|
|
|
10
8
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
11
9
|
const SETTINGS_FILE = join(CLAUDE_DIR, "settings.json");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'pathe';
|
|
3
2
|
import { glob } from 'tinyglobby';
|
|
4
|
-
import { e as executionTracer } from '../shared/ccjk.
|
|
5
|
-
import { f as fsParadigm } from '../shared/ccjk.
|
|
6
|
-
import '
|
|
3
|
+
import { e as executionTracer } from '../shared/ccjk.CePkJq2S.mjs';
|
|
4
|
+
import { f as fsParadigm } from '../shared/ccjk.BxSmJ8B7.mjs';
|
|
5
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
6
|
+
import './index2.mjs';
|
|
7
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
7
8
|
|
|
8
9
|
const DEPTH_TOKEN_BUDGETS = {
|
|
9
10
|
L0: 100,
|