ccjk 13.6.5 → 13.6.7
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-config-selector.mjs +6 -4
- package/dist/chunks/auto-updater.mjs +100 -2
- package/dist/chunks/banner.mjs +0 -16
- package/dist/chunks/ccjk-mcp.mjs +2 -2
- package/dist/chunks/ccr.mjs +5 -3
- package/dist/chunks/check-updates.mjs +12 -1
- package/dist/chunks/claude-code-config-manager.mjs +3 -1
- package/dist/chunks/claude-code-incremental-manager.mjs +46 -20
- package/dist/chunks/claude-config.mjs +36 -3
- package/dist/chunks/claude-wrapper.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +4 -5
- package/dist/chunks/codex-config-switch.mjs +3 -2
- package/dist/chunks/codex-provider-manager.mjs +1 -0
- package/dist/chunks/codex.mjs +3 -359
- package/dist/chunks/config-switch.mjs +23 -10
- package/dist/chunks/config.mjs +1 -1
- package/dist/chunks/config2.mjs +3 -3
- package/dist/chunks/constants.mjs +1 -1
- package/dist/chunks/doctor.mjs +1 -1
- package/dist/chunks/features.mjs +76 -11
- package/dist/chunks/index10.mjs +15 -15
- package/dist/chunks/init.mjs +14 -30
- package/dist/chunks/installer.mjs +3 -3
- package/dist/chunks/mcp-cli.mjs +17 -16
- package/dist/chunks/mcp.mjs +8 -7
- package/dist/chunks/memory-check.mjs +1 -1
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/platform.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +12 -10
- package/dist/chunks/research.mjs +225 -27
- package/dist/chunks/smart-defaults.mjs +2 -2
- package/dist/chunks/uninstall.mjs +1 -1
- package/dist/chunks/update.mjs +14 -13
- package/dist/chunks/version-checker.mjs +11 -1
- package/dist/cli.mjs +5 -1
- package/dist/i18n/locales/en/cli.json +0 -4
- package/dist/i18n/locales/en/menu.json +3 -3
- package/dist/i18n/locales/en/notification.json +2 -2
- package/dist/i18n/locales/zh-CN/cli.json +0 -4
- package/dist/i18n/locales/zh-CN/menu.json +3 -3
- package/dist/i18n/locales/zh-CN/notification.json +2 -2
- package/dist/shared/{ccjk.DvAP4XfP.mjs → ccjk.B4aXNclK.mjs} +2 -2
- package/dist/shared/ccjk.BI-hdI7P.mjs +30 -0
- package/dist/shared/{ccjk.C4m4ypdk.mjs → ccjk.DHaUdzX3.mjs} +4 -3
- package/dist/shared/ccjk.DKXs7Fbm.mjs +361 -0
- package/dist/shared/{ccjk.BP5hsTZQ.mjs → ccjk.Dz0ssUQx.mjs} +1 -1
- package/package.json +3 -1
- package/templates/common/workflow/essential/en/feat.md +68 -291
- package/templates/common/workflow/sixStep/en/workflow.md +56 -330
package/dist/chunks/codex.mjs
CHANGED
|
@@ -14,11 +14,11 @@ import { updateZcfConfig, readZcfConfig, readDefaultTomlConfig, updateTomlConfig
|
|
|
14
14
|
import { h as applyAiLanguageDirective } from './config.mjs';
|
|
15
15
|
import { exists, readFile, ensureDir, writeFileAtomic, writeFile, copyDir, copyFile } from './fs-operations.mjs';
|
|
16
16
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
17
|
-
import {
|
|
17
|
+
import { i as isWindows, l as getMcpCommand, m as getSystemRoot, w as wrapCommandWithSudo, n as normalizeTomlPath } from './platform.mjs';
|
|
18
18
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
19
19
|
import { resolveAiOutputLanguage } from './prompts.mjs';
|
|
20
20
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
21
|
-
import {
|
|
21
|
+
import { M as MCP_SERVICE_CONFIGS, i as isMcpServiceCompatible, g as getMcpServices, b as getMcpServicesWithCompatibility } from '../shared/ccjk.DKXs7Fbm.mjs';
|
|
22
22
|
import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
23
23
|
|
|
24
24
|
function detectConfigManagementMode() {
|
|
@@ -49,362 +49,6 @@ function detectConfigManagementMode() {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const MCP_SERVICE_CONFIGS = [
|
|
53
|
-
// Documentation and research services
|
|
54
|
-
{
|
|
55
|
-
id: "context7",
|
|
56
|
-
requiresApiKey: false,
|
|
57
|
-
defaultSelected: true,
|
|
58
|
-
config: {
|
|
59
|
-
type: "stdio",
|
|
60
|
-
command: "npx",
|
|
61
|
-
args: ["-y", "@upstash/context7-mcp@latest"],
|
|
62
|
-
env: {}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: "open-websearch",
|
|
67
|
-
requiresApiKey: false,
|
|
68
|
-
config: {
|
|
69
|
-
type: "stdio",
|
|
70
|
-
command: "npx",
|
|
71
|
-
args: ["-y", "open-websearch@latest"],
|
|
72
|
-
env: {
|
|
73
|
-
MODE: "stdio",
|
|
74
|
-
DEFAULT_SEARCH_ENGINE: "duckduckgo",
|
|
75
|
-
ALLOWED_SEARCH_ENGINES: "duckduckgo,bing,brave"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: "mcp-deepwiki",
|
|
81
|
-
requiresApiKey: false,
|
|
82
|
-
config: {
|
|
83
|
-
type: "stdio",
|
|
84
|
-
command: "npx",
|
|
85
|
-
args: ["-y", "mcp-deepwiki@latest"],
|
|
86
|
-
env: {}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "spec-workflow",
|
|
91
|
-
requiresApiKey: false,
|
|
92
|
-
config: {
|
|
93
|
-
type: "stdio",
|
|
94
|
-
command: "npx",
|
|
95
|
-
args: ["-y", "@pimzino/spec-workflow-mcp@latest"],
|
|
96
|
-
env: {}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "serena",
|
|
101
|
-
requiresApiKey: false,
|
|
102
|
-
config: {
|
|
103
|
-
type: "stdio",
|
|
104
|
-
command: "uvx",
|
|
105
|
-
args: ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "ide-assistant", "--enable-web-dashboard", "false"],
|
|
106
|
-
env: {}
|
|
107
|
-
},
|
|
108
|
-
platformRequirements: {
|
|
109
|
-
requiredCommands: ["uvx"]
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: "Playwright",
|
|
114
|
-
requiresApiKey: false,
|
|
115
|
-
config: {
|
|
116
|
-
type: "stdio",
|
|
117
|
-
command: "npx",
|
|
118
|
-
args: ["-y", "@playwright/mcp@latest", "--browser", "chromium"],
|
|
119
|
-
env: {}
|
|
120
|
-
},
|
|
121
|
-
platformRequirements: {
|
|
122
|
-
platforms: ["macos", "windows"],
|
|
123
|
-
requiresGui: true
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
id: "intent-engine",
|
|
128
|
-
requiresApiKey: false,
|
|
129
|
-
config: {
|
|
130
|
-
type: "stdio",
|
|
131
|
-
command: "npx",
|
|
132
|
-
args: ["-y", "@origintask/intent-engine@latest", "mcp"],
|
|
133
|
-
env: {}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: "sqlite",
|
|
138
|
-
requiresApiKey: false,
|
|
139
|
-
config: {
|
|
140
|
-
type: "stdio",
|
|
141
|
-
command: "npx",
|
|
142
|
-
args: ["-y", "@anthropic-ai/mcp-server-sqlite@latest"],
|
|
143
|
-
env: {}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
];
|
|
147
|
-
async function getMcpServices() {
|
|
148
|
-
ensureI18nInitialized();
|
|
149
|
-
const mcpServiceList = [
|
|
150
|
-
{
|
|
151
|
-
id: "context7",
|
|
152
|
-
name: i18n.t("mcp:services.context7.name"),
|
|
153
|
-
description: i18n.t("mcp:services.context7.description")
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: "open-websearch",
|
|
157
|
-
name: i18n.t("mcp:services.open-websearch.name"),
|
|
158
|
-
description: i18n.t("mcp:services.open-websearch.description")
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: "mcp-deepwiki",
|
|
162
|
-
name: i18n.t("mcp:services.mcp-deepwiki.name"),
|
|
163
|
-
description: i18n.t("mcp:services.mcp-deepwiki.description")
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
id: "spec-workflow",
|
|
167
|
-
name: i18n.t("mcp:services.spec-workflow.name"),
|
|
168
|
-
description: i18n.t("mcp:services.spec-workflow.description")
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
id: "serena",
|
|
172
|
-
name: i18n.t("mcp:services.serena.name"),
|
|
173
|
-
description: i18n.t("mcp:services.serena.description")
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
id: "Playwright",
|
|
177
|
-
name: i18n.t("mcp:services.Playwright.name"),
|
|
178
|
-
description: i18n.t("mcp:services.Playwright.description")
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
id: "intent-engine",
|
|
182
|
-
name: i18n.t("mcp:services.intent-engine.name"),
|
|
183
|
-
description: i18n.t("mcp:services.intent-engine.description")
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
id: "sqlite",
|
|
187
|
-
name: i18n.t("mcp:services.sqlite.name"),
|
|
188
|
-
description: i18n.t("mcp:services.sqlite.description")
|
|
189
|
-
}
|
|
190
|
-
];
|
|
191
|
-
return MCP_SERVICE_CONFIGS.map((config) => {
|
|
192
|
-
const serviceInfo = mcpServiceList.find((s) => s.id === config.id);
|
|
193
|
-
const service = {
|
|
194
|
-
id: config.id,
|
|
195
|
-
name: serviceInfo?.name || config.id,
|
|
196
|
-
description: serviceInfo?.description || "",
|
|
197
|
-
requiresApiKey: config.requiresApiKey,
|
|
198
|
-
config: config.config
|
|
199
|
-
};
|
|
200
|
-
if (config.apiKeyEnvVar) {
|
|
201
|
-
service.apiKeyEnvVar = config.apiKeyEnvVar;
|
|
202
|
-
}
|
|
203
|
-
return service;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
async function getMcpService(id) {
|
|
207
|
-
const services = await getMcpServices();
|
|
208
|
-
return services.find((service) => service.id === id);
|
|
209
|
-
}
|
|
210
|
-
function detectPlatform() {
|
|
211
|
-
const platform = process__default.platform;
|
|
212
|
-
const env = process__default.env;
|
|
213
|
-
const isWsl = !!(env.WSL_DISTRO_NAME || env.WSLENV || env.PATH && env.PATH.includes("/mnt/c/"));
|
|
214
|
-
const isTermux = !!(env.TERMUX_VERSION || env.PREFIX?.includes("com.termux"));
|
|
215
|
-
const isHeadless = !!(env.SSH_CLIENT || env.SSH_TTY || env.SSH_CONNECTION || !env.DISPLAY && platform === "linux");
|
|
216
|
-
const hasGui = (() => {
|
|
217
|
-
if (platform === "darwin")
|
|
218
|
-
return true;
|
|
219
|
-
if (platform === "win32")
|
|
220
|
-
return !isHeadless;
|
|
221
|
-
if (isWsl || isTermux)
|
|
222
|
-
return false;
|
|
223
|
-
if (platform === "linux")
|
|
224
|
-
return !!env.DISPLAY || !!env.WAYLAND_DISPLAY;
|
|
225
|
-
return false;
|
|
226
|
-
})();
|
|
227
|
-
let detectedPlatform;
|
|
228
|
-
if (platform === "darwin") {
|
|
229
|
-
detectedPlatform = "macos";
|
|
230
|
-
} else if (platform === "win32") {
|
|
231
|
-
detectedPlatform = "windows";
|
|
232
|
-
} else if (isWsl) {
|
|
233
|
-
detectedPlatform = "wsl";
|
|
234
|
-
} else if (isTermux) {
|
|
235
|
-
detectedPlatform = "termux";
|
|
236
|
-
} else if (platform === "linux") {
|
|
237
|
-
detectedPlatform = "linux";
|
|
238
|
-
} else {
|
|
239
|
-
detectedPlatform = "unknown";
|
|
240
|
-
}
|
|
241
|
-
return {
|
|
242
|
-
platform: detectedPlatform,
|
|
243
|
-
hasGui,
|
|
244
|
-
isHeadless
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
function isCommandAvailable(command) {
|
|
248
|
-
try {
|
|
249
|
-
execSync(`which ${command}`, { stdio: "ignore" });
|
|
250
|
-
return true;
|
|
251
|
-
} catch {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
function isMcpServiceCompatible(serviceId) {
|
|
256
|
-
const config = MCP_SERVICE_CONFIGS.find((c) => c.id === serviceId);
|
|
257
|
-
if (!config) {
|
|
258
|
-
return { compatible: false, reason: "Service not found" };
|
|
259
|
-
}
|
|
260
|
-
const requirements = config.platformRequirements;
|
|
261
|
-
if (!requirements) {
|
|
262
|
-
return { compatible: true };
|
|
263
|
-
}
|
|
264
|
-
const { platform, hasGui } = detectPlatform();
|
|
265
|
-
if (requirements.platforms && requirements.platforms.length > 0) {
|
|
266
|
-
if (platform !== "unknown" && !requirements.platforms.includes(platform)) {
|
|
267
|
-
return {
|
|
268
|
-
compatible: false,
|
|
269
|
-
reason: `Not supported on ${platform}. Requires: ${requirements.platforms.join(", ")}`
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
if (requirements.requiresGui && !hasGui) {
|
|
274
|
-
return {
|
|
275
|
-
compatible: false,
|
|
276
|
-
reason: "Requires GUI environment (X11/Wayland/Desktop)"
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
if (requirements.requiredCommands) {
|
|
280
|
-
for (const cmd of requirements.requiredCommands) {
|
|
281
|
-
if (!isCommandAvailable(cmd)) {
|
|
282
|
-
return {
|
|
283
|
-
compatible: false,
|
|
284
|
-
reason: `Required command not found: ${cmd}`
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return { compatible: true };
|
|
290
|
-
}
|
|
291
|
-
async function getMcpServicesWithCompatibility() {
|
|
292
|
-
const allServices = await getMcpServices();
|
|
293
|
-
return allServices.map((service) => {
|
|
294
|
-
const { compatible, reason } = isMcpServiceCompatible(service.id);
|
|
295
|
-
return {
|
|
296
|
-
...service,
|
|
297
|
-
compatible,
|
|
298
|
-
incompatibleReason: reason
|
|
299
|
-
};
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
const DEFAULT_MCP_TOOL_SEARCH_CONFIG = {
|
|
303
|
-
mcpAutoEnableThreshold: 10,
|
|
304
|
-
excludedServices: ["mcp-search", "context7"]
|
|
305
|
-
};
|
|
306
|
-
function getMcpToolSearchConfig() {
|
|
307
|
-
const env = process__default.env;
|
|
308
|
-
return {
|
|
309
|
-
mcpAutoEnableThreshold: env.MCP_AUTO_THRESHOLD || DEFAULT_MCP_TOOL_SEARCH_CONFIG.mcpAutoEnableThreshold,
|
|
310
|
-
dynamicServiceDiscovery: env.MCP_DYNAMIC_DISCOVERY !== "false",
|
|
311
|
-
listChangedNotifications: env.MCP_LIST_CHANGED !== "false",
|
|
312
|
-
excludedServices: env.MCP_EXCLUDED_SERVICES?.split(",").map((s) => s.trim()).filter(Boolean) || DEFAULT_MCP_TOOL_SEARCH_CONFIG.excludedServices
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
class DynamicMcpServiceRegistry {
|
|
316
|
-
_services = /* @__PURE__ */ new Map();
|
|
317
|
-
_listeners = /* @__PURE__ */ new Set();
|
|
318
|
-
_enabled = false;
|
|
319
|
-
/**
|
|
320
|
-
* Enable dynamic service discovery
|
|
321
|
-
*/
|
|
322
|
-
enable() {
|
|
323
|
-
this._enabled = true;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Disable dynamic service discovery
|
|
327
|
-
*/
|
|
328
|
-
disable() {
|
|
329
|
-
this._enabled = false;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Check if dynamic discovery is enabled
|
|
333
|
-
*/
|
|
334
|
-
isEnabled() {
|
|
335
|
-
return this._enabled;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Add a service dynamically
|
|
339
|
-
*/
|
|
340
|
-
addService(serviceId, config) {
|
|
341
|
-
if (!this._enabled) {
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
|
-
const isUpdate = this._services.has(serviceId);
|
|
345
|
-
this._services.set(serviceId, config);
|
|
346
|
-
this._notify({
|
|
347
|
-
type: isUpdate ? "updated" : "added",
|
|
348
|
-
serviceId,
|
|
349
|
-
timestamp: Date.now(),
|
|
350
|
-
config
|
|
351
|
-
});
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Remove a service dynamically
|
|
356
|
-
*/
|
|
357
|
-
removeService(serviceId) {
|
|
358
|
-
if (!this._enabled || !this._services.has(serviceId)) {
|
|
359
|
-
return false;
|
|
360
|
-
}
|
|
361
|
-
const config = this._services.get(serviceId);
|
|
362
|
-
this._services.delete(serviceId);
|
|
363
|
-
this._notify({
|
|
364
|
-
type: "removed",
|
|
365
|
-
serviceId,
|
|
366
|
-
timestamp: Date.now(),
|
|
367
|
-
config
|
|
368
|
-
});
|
|
369
|
-
return true;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Get a service configuration
|
|
373
|
-
*/
|
|
374
|
-
getService(serviceId) {
|
|
375
|
-
return this._services.get(serviceId);
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* List all dynamically registered services
|
|
379
|
-
*/
|
|
380
|
-
listServices() {
|
|
381
|
-
return new Map(this._services);
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Subscribe to list change notifications
|
|
385
|
-
*/
|
|
386
|
-
subscribe(listener) {
|
|
387
|
-
this._listeners.add(listener);
|
|
388
|
-
return () => this._listeners.delete(listener);
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Notify all listeners of a change
|
|
392
|
-
*/
|
|
393
|
-
_notify(notification) {
|
|
394
|
-
const toolSearchConfig = getMcpToolSearchConfig();
|
|
395
|
-
if (toolSearchConfig.listChangedNotifications) {
|
|
396
|
-
for (const listener of Array.from(this._listeners)) {
|
|
397
|
-
try {
|
|
398
|
-
listener(notification);
|
|
399
|
-
} catch (error) {
|
|
400
|
-
console.error("Error notifying MCP list change listener:", error);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
const dynamicMcpRegistry = new DynamicMcpServiceRegistry();
|
|
407
|
-
|
|
408
52
|
function applyCodexPlatformCommand(config) {
|
|
409
53
|
if (isWindows() && config.command) {
|
|
410
54
|
const mcpCmd = getMcpCommand(config.command);
|
|
@@ -2425,4 +2069,4 @@ const codex = {
|
|
|
2425
2069
|
writeCodexConfig: writeCodexConfig
|
|
2426
2070
|
};
|
|
2427
2071
|
|
|
2428
|
-
export {
|
|
2072
|
+
export { switchToOfficialLogin as a, switchToProvider as b, runCodexUpdate as c, detectConfigManagementMode as d, backupCodexComplete as e, writeAuthFile as f, applyCodexPlatformCommand as g, runCodexFullInit as h, runCodexUninstall as i, configureCodexAiMemoryFeature as j, configureCodexDefaultModelFeature as k, listCodexProviders as l, configureCodexMcp as m, configureCodexApi as n, configureCodexPresetFeature as o, runCodexWorkflowImportWithLanguageSelection as p, codex as q, readCodexConfig as r, switchCodexProvider as s, writeCodexConfig as w };
|
|
@@ -5,6 +5,7 @@ import { resolveCodeToolType, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './c
|
|
|
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
|
+
import { s as setMyclaudeActiveProviderProfile, c as syncMyclaudeProviderProfilesFromClaudeConfig } from './claude-config.mjs';
|
|
8
9
|
import { s as switchCodexProvider, l as listCodexProviders, r as readCodexConfig, a as switchToOfficialLogin, b as switchToProvider } from './codex.mjs';
|
|
9
10
|
import { h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
|
|
10
11
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
@@ -33,19 +34,19 @@ import 'node:fs/promises';
|
|
|
33
34
|
import './json-config.mjs';
|
|
34
35
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
35
36
|
import './config.mjs';
|
|
36
|
-
import '
|
|
37
|
+
import '../shared/ccjk.DScm_NnL.mjs';
|
|
37
38
|
import './platform.mjs';
|
|
38
39
|
import './main.mjs';
|
|
39
40
|
import 'module';
|
|
40
41
|
import 'node:child_process';
|
|
41
42
|
import 'node:stream';
|
|
42
|
-
import '../shared/ccjk.DScm_NnL.mjs';
|
|
43
43
|
import './index8.mjs';
|
|
44
44
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
45
45
|
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
46
46
|
import './prompts.mjs';
|
|
47
47
|
import '../shared/ccjk.gDEDGD_t.mjs';
|
|
48
48
|
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
49
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
49
50
|
|
|
50
51
|
async function configSwitchCommand(options) {
|
|
51
52
|
try {
|
|
@@ -78,9 +79,18 @@ function resolveCodeType(codeType) {
|
|
|
78
79
|
}
|
|
79
80
|
return DEFAULT_CODE_TOOL_TYPE;
|
|
80
81
|
}
|
|
82
|
+
function syncMyclaudeStateIfNeeded(codeType, currentProfileId) {
|
|
83
|
+
if (codeType !== "myclaude") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (currentProfileId !== void 0) {
|
|
87
|
+
setMyclaudeActiveProviderProfile(currentProfileId);
|
|
88
|
+
}
|
|
89
|
+
syncMyclaudeProviderProfilesFromClaudeConfig(ClaudeCodeConfigManager.readConfig());
|
|
90
|
+
}
|
|
81
91
|
async function handleList(codeType) {
|
|
82
92
|
const targetCodeType = resolveCodeType(codeType);
|
|
83
|
-
if (targetCodeType === "claude-code") {
|
|
93
|
+
if (targetCodeType === "claude-code" || targetCodeType === "myclaude") {
|
|
84
94
|
await listClaudeCodeProfiles();
|
|
85
95
|
} else if (targetCodeType === "codex") {
|
|
86
96
|
await listCodexProvidersWithDisplay();
|
|
@@ -133,18 +143,19 @@ async function listClaudeCodeProfiles() {
|
|
|
133
143
|
}
|
|
134
144
|
async function handleDirectSwitch(codeType, target) {
|
|
135
145
|
const resolvedCodeType = resolveCodeType(codeType);
|
|
136
|
-
if (resolvedCodeType === "claude-code") {
|
|
137
|
-
await handleClaudeCodeDirectSwitch(target);
|
|
146
|
+
if (resolvedCodeType === "claude-code" || resolvedCodeType === "myclaude") {
|
|
147
|
+
await handleClaudeCodeDirectSwitch(target, resolvedCodeType);
|
|
138
148
|
} else if (resolvedCodeType === "codex") {
|
|
139
149
|
await switchCodexProvider(target);
|
|
140
150
|
}
|
|
141
151
|
}
|
|
142
|
-
async function handleClaudeCodeDirectSwitch(target) {
|
|
152
|
+
async function handleClaudeCodeDirectSwitch(target, codeType = "claude-code") {
|
|
143
153
|
if (target === "official") {
|
|
144
154
|
const result = await ClaudeCodeConfigManager.switchToOfficial();
|
|
145
155
|
if (result.success) {
|
|
146
156
|
try {
|
|
147
157
|
await ClaudeCodeConfigManager.applyProfileSettings(null);
|
|
158
|
+
syncMyclaudeStateIfNeeded(codeType, "");
|
|
148
159
|
console.log(a.green(i18n.t("multi-config:successfullySwitchedToOfficial")));
|
|
149
160
|
} catch (error) {
|
|
150
161
|
const reason = error instanceof Error ? error.message : String(error);
|
|
@@ -159,6 +170,7 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
159
170
|
try {
|
|
160
171
|
const profile = ClaudeCodeConfigManager.getProfileById("ccr-proxy");
|
|
161
172
|
await ClaudeCodeConfigManager.applyProfileSettings(profile);
|
|
173
|
+
syncMyclaudeStateIfNeeded(codeType, "ccr-proxy");
|
|
162
174
|
console.log(a.green(i18n.t("multi-config:successfullySwitchedToCcr")));
|
|
163
175
|
} catch (error) {
|
|
164
176
|
const reason = error instanceof Error ? error.message : String(error);
|
|
@@ -191,6 +203,7 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
191
203
|
if (result.success) {
|
|
192
204
|
try {
|
|
193
205
|
await ClaudeCodeConfigManager.applyProfileSettings({ ...resolvedProfile, id: resolvedId });
|
|
206
|
+
syncMyclaudeStateIfNeeded(codeType, resolvedId);
|
|
194
207
|
console.log(a.green(i18n.t("multi-config:successfullySwitchedToProfile", { name: resolvedProfile.name })));
|
|
195
208
|
} catch (error) {
|
|
196
209
|
const reason = error instanceof Error ? error.message : String(error);
|
|
@@ -203,13 +216,13 @@ async function handleClaudeCodeDirectSwitch(target) {
|
|
|
203
216
|
}
|
|
204
217
|
async function handleInteractiveSwitch(codeType) {
|
|
205
218
|
const resolvedCodeType = resolveCodeType(codeType);
|
|
206
|
-
if (resolvedCodeType === "claude-code") {
|
|
207
|
-
await handleClaudeCodeInteractiveSwitch();
|
|
219
|
+
if (resolvedCodeType === "claude-code" || resolvedCodeType === "myclaude") {
|
|
220
|
+
await handleClaudeCodeInteractiveSwitch(resolvedCodeType);
|
|
208
221
|
} else if (resolvedCodeType === "codex") {
|
|
209
222
|
await handleCodexInteractiveSwitch();
|
|
210
223
|
}
|
|
211
224
|
}
|
|
212
|
-
async function handleClaudeCodeInteractiveSwitch() {
|
|
225
|
+
async function handleClaudeCodeInteractiveSwitch(codeType = "claude-code") {
|
|
213
226
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
214
227
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
215
228
|
console.log(a.yellow(i18n.t("multi-config:noClaudeCodeProfilesAvailable")));
|
|
@@ -249,7 +262,7 @@ async function handleClaudeCodeInteractiveSwitch() {
|
|
|
249
262
|
console.log(a.yellow(i18n.t("multi-config:cancelled")));
|
|
250
263
|
return;
|
|
251
264
|
}
|
|
252
|
-
await handleClaudeCodeDirectSwitch(selectedConfig);
|
|
265
|
+
await handleClaudeCodeDirectSwitch(selectedConfig, codeType);
|
|
253
266
|
} catch (error) {
|
|
254
267
|
if (error.name === "ExitPromptError") {
|
|
255
268
|
console.log(a.green(`
|
package/dist/chunks/config.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { i as inquirer } from './index6.mjs';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { CLAUDE_DIR, SETTINGS_FILE, CLAUDE_VSC_CONFIG_FILE, AI_OUTPUT_LANGUAGES } from './constants.mjs';
|
|
6
6
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { d as setPrimaryApiKey, e as addCompletedOnboarding, g as deepMerge } from './claude-config.mjs';
|
|
8
8
|
import { exists, ensureDir, copyDir, writeFileAtomic, copyFile } from './fs-operations.mjs';
|
|
9
9
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
10
10
|
import { m as mergeAndCleanPermissions } from '../shared/ccjk.DScm_NnL.mjs';
|
package/dist/chunks/config2.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
|
8
8
|
import { i as inquirer } from './index6.mjs';
|
|
9
9
|
import { SETTINGS_FILE } from './constants.mjs';
|
|
10
10
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { d as setPrimaryApiKey, e as addCompletedOnboarding } from './claude-config.mjs';
|
|
12
12
|
import { b as backupExistingConfig } from './config.mjs';
|
|
13
13
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
14
14
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
@@ -415,7 +415,7 @@ async function setupCcrConfiguration() {
|
|
|
415
415
|
console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
|
|
416
416
|
await configureCcrProxy(existingConfig);
|
|
417
417
|
try {
|
|
418
|
-
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
418
|
+
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
419
419
|
const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
420
420
|
manageApiKeyApproval(apiKey);
|
|
421
421
|
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
@@ -449,7 +449,7 @@ async function setupCcrConfiguration() {
|
|
|
449
449
|
console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
|
|
450
450
|
}
|
|
451
451
|
try {
|
|
452
|
-
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
452
|
+
const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
453
453
|
const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
|
|
454
454
|
manageApiKeyApproval(apiKey);
|
|
455
455
|
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
@@ -80,7 +80,7 @@ const LEGACY_ZCF_CONFIG_FILES = [
|
|
|
80
80
|
const ZCF_CONFIG_DIR = CCJK_CONFIG_DIR;
|
|
81
81
|
const ZCF_CONFIG_FILE = CCJK_CONFIG_FILE;
|
|
82
82
|
const CODE_TOOL_TYPES = ["claude-code", "myclaude", "codex", "aider", "continue", "cline", "cursor"];
|
|
83
|
-
const DEFAULT_CODE_TOOL_TYPE = "
|
|
83
|
+
const DEFAULT_CODE_TOOL_TYPE = "myclaude";
|
|
84
84
|
const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "myclaude"];
|
|
85
85
|
const CODE_TOOL_BANNERS = {
|
|
86
86
|
"claude-code": "for Claude Code",
|
package/dist/chunks/doctor.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { getApiProviderPresets } from './api-providers.mjs';
|
|
|
6
6
|
import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
|
|
7
7
|
import { i18n } from './index2.mjs';
|
|
8
8
|
import { g as getPermissionManager } from '../shared/ccjk.SPoXMvZD.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { h as commandExists } from './platform.mjs';
|
|
10
10
|
import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
|
|
11
11
|
import { platform, userInfo, homedir } from 'node:os';
|
|
12
12
|
import ora from './index8.mjs';
|