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
|
@@ -38,10 +38,12 @@ import 'module';
|
|
|
38
38
|
import 'node:child_process';
|
|
39
39
|
import 'node:stream';
|
|
40
40
|
import '../shared/ccjk.DScm_NnL.mjs';
|
|
41
|
-
import '../shared/ccjk.
|
|
41
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
42
|
+
import '../shared/ccjk.Dz0ssUQx.mjs';
|
|
42
43
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
43
44
|
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
44
45
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
46
|
+
import '../shared/ccjk.BI-hdI7P.mjs';
|
|
45
47
|
|
|
46
48
|
function getCurrentCodeTool() {
|
|
47
49
|
const config = readZcfConfig();
|
|
@@ -85,7 +87,7 @@ async function showApiConfigMenu(title, options) {
|
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
async function handleOfficialLogin(codeTool, isZh) {
|
|
88
|
-
if (codeTool === "claude-code") {
|
|
90
|
+
if (codeTool === "claude-code" || codeTool === "myclaude") {
|
|
89
91
|
const result = await ClaudeCodeConfigManager.switchToOfficial();
|
|
90
92
|
if (result.success) {
|
|
91
93
|
console.log("");
|
|
@@ -108,7 +110,7 @@ async function handleOfficialLogin(codeTool, isZh) {
|
|
|
108
110
|
async function handleCustomConfig(_isZh, context) {
|
|
109
111
|
try {
|
|
110
112
|
const codeTool = getCurrentCodeTool();
|
|
111
|
-
if (codeTool === "claude-code" && context === "init") {
|
|
113
|
+
if ((codeTool === "claude-code" || codeTool === "myclaude") && context === "init") {
|
|
112
114
|
const { addProfileDirect } = await import('./claude-code-incremental-manager.mjs');
|
|
113
115
|
await addProfileDirect();
|
|
114
116
|
} else {
|
|
@@ -120,7 +122,7 @@ async function handleCustomConfig(_isZh, context) {
|
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
async function handleCcrProxy(codeTool, isZh) {
|
|
123
|
-
if (codeTool === "claude-code") {
|
|
125
|
+
if (codeTool === "claude-code" || codeTool === "myclaude") {
|
|
124
126
|
const result = await ClaudeCodeConfigManager.switchToCcr();
|
|
125
127
|
if (result.success) {
|
|
126
128
|
console.log("");
|
|
@@ -4,7 +4,7 @@ import { exec as q } from './main.mjs';
|
|
|
4
4
|
import { ensureI18nInitialized, i18n, format } from './index2.mjs';
|
|
5
5
|
import { s as shouldUseSudoForGlobalInstall } from './platform.mjs';
|
|
6
6
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
7
|
-
import { checkClaudeCodeVersion, fixBrokenNpmSymlink, checkCcrVersion, handleDuplicateInstallations, checkCometixLineVersion } from './version-checker.mjs';
|
|
7
|
+
import { checkClaudeCodeVersion, fixBrokenNpmSymlink, checkCcrVersion, handleDuplicateInstallations, checkCometixLineVersion, checkMyclaudeVersion } from './version-checker.mjs';
|
|
8
8
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
9
9
|
import 'node:process';
|
|
10
10
|
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
@@ -290,6 +290,58 @@ async function updateCometixLine(force = false, skipPrompt = false) {
|
|
|
290
290
|
return false;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
+
async function updateMyclaude(force = false, skipPrompt = false) {
|
|
294
|
+
ensureI18nInitialized();
|
|
295
|
+
const spinner = ora(i18n.t("updater:checkingVersion")).start();
|
|
296
|
+
try {
|
|
297
|
+
const { installed, currentVersion, latestVersion, needsUpdate } = await checkMyclaudeVersion();
|
|
298
|
+
spinner.stop();
|
|
299
|
+
if (!installed) {
|
|
300
|
+
console.log(a.yellow("myclaude is not installed"));
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
if (!needsUpdate && !force) {
|
|
304
|
+
console.log(a.green(`myclaude is up to date (v${currentVersion || ""})`));
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
if (!latestVersion) {
|
|
308
|
+
console.log(a.yellow(i18n.t("updater:cannotCheckVersion")));
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
console.log(a.green(format(i18n.t("updater:currentVersion"), { version: currentVersion || "" })));
|
|
312
|
+
console.log(a.green(format(i18n.t("updater:latestVersion"), { version: latestVersion })));
|
|
313
|
+
if (!skipPrompt) {
|
|
314
|
+
const confirm = await promptBoolean({
|
|
315
|
+
message: format(i18n.t("updater:confirmUpdate"), { tool: "myclaude" }),
|
|
316
|
+
defaultValue: true
|
|
317
|
+
});
|
|
318
|
+
if (!confirm) {
|
|
319
|
+
console.log(a.gray(i18n.t("updater:updateSkipped")));
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
console.log(a.green(format(i18n.t("updater:autoUpdating"), { tool: "myclaude" })));
|
|
324
|
+
}
|
|
325
|
+
const updateSpinner = ora(format(i18n.t("updater:updating"), { tool: "myclaude" })).start();
|
|
326
|
+
try {
|
|
327
|
+
await execWithSudoIfNeeded("npm", ["update", "-g", "myclaude-code"]);
|
|
328
|
+
const installResult = await q("myclaude", ["install", "--force"]);
|
|
329
|
+
if (installResult.exitCode !== 0) {
|
|
330
|
+
throw new Error(installResult.stderr || `Command failed with exit code ${installResult.exitCode}`);
|
|
331
|
+
}
|
|
332
|
+
updateSpinner.succeed(format(i18n.t("updater:updateSuccess"), { tool: "myclaude" }));
|
|
333
|
+
return true;
|
|
334
|
+
} catch (error) {
|
|
335
|
+
updateSpinner.fail(format(i18n.t("updater:updateFailed"), { tool: "myclaude" }));
|
|
336
|
+
console.error(a.red(error instanceof Error ? error.message : String(error)));
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
} catch (error) {
|
|
340
|
+
spinner.fail(i18n.t("updater:checkFailed"));
|
|
341
|
+
console.error(a.red(error instanceof Error ? error.message : String(error)));
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
293
345
|
async function checkAndUpdateTools(skipPrompt = false) {
|
|
294
346
|
ensureI18nInitialized();
|
|
295
347
|
console.log(a.bold.cyan(`
|
|
@@ -363,6 +415,52 @@ async function checkAndUpdateTools(skipPrompt = false) {
|
|
|
363
415
|
process.exit(0);
|
|
364
416
|
}
|
|
365
417
|
}
|
|
418
|
+
async function checkAndUpdateMyclaudeTools(skipPrompt = false) {
|
|
419
|
+
ensureI18nInitialized();
|
|
420
|
+
console.log(a.bold.cyan(`
|
|
421
|
+
\u{1F50D} ${i18n.t("updater:checkingTools")}
|
|
422
|
+
`));
|
|
423
|
+
const results = [];
|
|
424
|
+
let ccjkUpdated = false;
|
|
425
|
+
let ccjkResult = null;
|
|
426
|
+
console.log(a.bold("\u2728 myclaude"));
|
|
427
|
+
try {
|
|
428
|
+
const success = await updateMyclaude(false, skipPrompt);
|
|
429
|
+
results.push({ tool: "myclaude", success });
|
|
430
|
+
} catch (error) {
|
|
431
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
432
|
+
console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "myclaude" })}: ${errorMessage}`));
|
|
433
|
+
results.push({ tool: "myclaude", success: false, error: errorMessage });
|
|
434
|
+
}
|
|
435
|
+
console.log();
|
|
436
|
+
console.log(a.bold("\u{1F4E6} CCJK"));
|
|
437
|
+
try {
|
|
438
|
+
const result = await checkCcjkVersionAndPrompt(skipPrompt);
|
|
439
|
+
ccjkUpdated = result.updated;
|
|
440
|
+
ccjkResult = {
|
|
441
|
+
tool: "CCJK",
|
|
442
|
+
success: result.success,
|
|
443
|
+
error: result.error
|
|
444
|
+
};
|
|
445
|
+
} catch (error) {
|
|
446
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
447
|
+
console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCJK" })}: ${errorMessage}`));
|
|
448
|
+
ccjkResult = { tool: "CCJK", success: false, error: errorMessage };
|
|
449
|
+
}
|
|
450
|
+
console.log(a.bold.cyan(`
|
|
451
|
+
\u{1F4CB} ${i18n.t("updater:updateSummary")}`));
|
|
452
|
+
for (const result of ccjkResult ? [ccjkResult, ...results] : results) {
|
|
453
|
+
if (result.success) {
|
|
454
|
+
console.log(a.green(`\u2714 ${result.tool}: ${i18n.t("updater:success")}`));
|
|
455
|
+
} else {
|
|
456
|
+
console.log(a.red(`\u274C ${result.tool}: ${i18n.t("updater:failed")} ${result.error ? `(${result.error})` : ""}`));
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (ccjkUpdated) {
|
|
460
|
+
console.log(a.yellow("\n\u26A0 Please run ccjk again to use the new version"));
|
|
461
|
+
process.exit(0);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
366
464
|
async function checkCcjkVersionAndPrompt(skipPrompt) {
|
|
367
465
|
try {
|
|
368
466
|
const { readFileSync } = await import('node:fs');
|
|
@@ -406,4 +504,4 @@ async function checkCcjkVersionAndPrompt(skipPrompt) {
|
|
|
406
504
|
}
|
|
407
505
|
}
|
|
408
506
|
|
|
409
|
-
export { checkAndUpdateTools, execWithSudoIfNeeded, updateCcr, updateClaudeCode, updateCometixLine };
|
|
507
|
+
export { checkAndUpdateMyclaudeTools, checkAndUpdateTools, execWithSudoIfNeeded, updateCcr, updateClaudeCode, updateCometixLine, updateMyclaude };
|
package/dist/chunks/banner.mjs
CHANGED
|
@@ -156,22 +156,6 @@ ${i18n.t("cli:commandDiscovery.title")}`));
|
|
|
156
156
|
console.log(` ${a.cyan(cmdPadded)} - ${a.white(desc)}`);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
console.log(a.green.bold(`
|
|
160
|
-
${i18n.t("cli:commandDiscovery.claudeCodeTitle")}`));
|
|
161
|
-
console.log(a.gray("\u2500".repeat(60)));
|
|
162
|
-
const claudeCommands = [
|
|
163
|
-
{ cmd: "/help", desc: i18n.t("cli:commandDiscovery.help"), descEn: "Show all commands" },
|
|
164
|
-
{ cmd: "/clear", desc: i18n.t("cli:commandDiscovery.clear"), descEn: "Clear conversation" },
|
|
165
|
-
{ cmd: "/reset", desc: i18n.t("cli:commandDiscovery.reset"), descEn: "Reset session" }
|
|
166
|
-
];
|
|
167
|
-
for (const { cmd, desc, descEn } of claudeCommands) {
|
|
168
|
-
const cmdPadded = cmd.padEnd(12);
|
|
169
|
-
if (isZhCN) {
|
|
170
|
-
console.log(` ${a.cyan(cmdPadded)} - ${a.white(desc)} ${a.gray(`(${descEn})`)}`);
|
|
171
|
-
} else {
|
|
172
|
-
console.log(` ${a.cyan(cmdPadded)} - ${a.white(desc)}`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
159
|
console.log(a.gray(`
|
|
176
160
|
${"\u2500".repeat(60)}`));
|
|
177
161
|
console.log(a.gray(` ${i18n.t("cli:commandDiscovery.footer")}
|
package/dist/chunks/ccjk-mcp.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { c as consola, a as analyzeProject, g as getTemplatesClient } from '../s
|
|
|
5
5
|
import { i as inquirer } from './index6.mjs';
|
|
6
6
|
import { CLAUDE_DIR } from './constants.mjs';
|
|
7
7
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { b as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
|
|
9
|
+
import { h as commandExists } from './platform.mjs';
|
|
10
10
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
import './index9.mjs';
|
package/dist/chunks/ccr.mjs
CHANGED
|
@@ -47,11 +47,13 @@ import '../shared/ccjk.DScm_NnL.mjs';
|
|
|
47
47
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
48
48
|
import './prompts.mjs';
|
|
49
49
|
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
50
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
50
51
|
import '../shared/ccjk.yYQMbHH3.mjs';
|
|
51
52
|
import './smart-defaults.mjs';
|
|
52
53
|
import '../shared/ccjk.DJuyfrlL.mjs';
|
|
53
54
|
import './features.mjs';
|
|
54
|
-
import '../shared/ccjk.
|
|
55
|
+
import '../shared/ccjk.Dz0ssUQx.mjs';
|
|
56
|
+
import '../shared/ccjk.BI-hdI7P.mjs';
|
|
55
57
|
import '../shared/ccjk.DbigonEQ.mjs';
|
|
56
58
|
import 'node:stream/promises';
|
|
57
59
|
import 'tar';
|
|
@@ -73,8 +75,8 @@ import './doctor.mjs';
|
|
|
73
75
|
import './api-providers.mjs';
|
|
74
76
|
import '../shared/ccjk.SPoXMvZD.mjs';
|
|
75
77
|
import '../shared/ccjk.J8YiPsOw.mjs';
|
|
76
|
-
import '../shared/ccjk.
|
|
77
|
-
import '../shared/ccjk.
|
|
78
|
+
import '../shared/ccjk.B4aXNclK.mjs';
|
|
79
|
+
import '../shared/ccjk.DHaUdzX3.mjs';
|
|
78
80
|
import './notification.mjs';
|
|
79
81
|
import '../shared/ccjk.BBizCO6_.mjs';
|
|
80
82
|
import '../shared/ccjk.D0g2ABGg.mjs';
|
|
@@ -2,7 +2,7 @@ import process__default from 'node:process';
|
|
|
2
2
|
import a from './index5.mjs';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
4
4
|
import { r as resolveCodeType } from '../shared/ccjk.yYQMbHH3.mjs';
|
|
5
|
-
import { checkAndUpdateTools } from './auto-updater.mjs';
|
|
5
|
+
import { checkAndUpdateTools, checkAndUpdateMyclaudeTools } from './auto-updater.mjs';
|
|
6
6
|
import { c as runCodexUpdate } from './codex.mjs';
|
|
7
7
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
8
8
|
import 'node:fs';
|
|
@@ -49,6 +49,7 @@ import '../shared/ccjk.DScm_NnL.mjs';
|
|
|
49
49
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
50
50
|
import './prompts.mjs';
|
|
51
51
|
import '../shared/ccjk.gDEDGD_t.mjs';
|
|
52
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
52
53
|
|
|
53
54
|
class ToolUpdateScheduler {
|
|
54
55
|
/**
|
|
@@ -62,6 +63,9 @@ class ToolUpdateScheduler {
|
|
|
62
63
|
case "claude-code":
|
|
63
64
|
await this.updateClaudeCodeTools(skipPrompt);
|
|
64
65
|
break;
|
|
66
|
+
case "myclaude":
|
|
67
|
+
await this.updateMyclaudeTools(skipPrompt);
|
|
68
|
+
break;
|
|
65
69
|
case "codex":
|
|
66
70
|
await this.updateCodexTools(skipPrompt);
|
|
67
71
|
break;
|
|
@@ -76,6 +80,13 @@ class ToolUpdateScheduler {
|
|
|
76
80
|
async updateClaudeCodeTools(skipPrompt) {
|
|
77
81
|
await checkAndUpdateTools(skipPrompt);
|
|
78
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Update myclaude related tools
|
|
85
|
+
* @param skipPrompt - Whether to skip interactive prompts
|
|
86
|
+
*/
|
|
87
|
+
async updateMyclaudeTools(skipPrompt) {
|
|
88
|
+
await checkAndUpdateMyclaudeTools(skipPrompt);
|
|
89
|
+
}
|
|
79
90
|
/**
|
|
80
91
|
* Update Codex tools
|
|
81
92
|
* @param skipPrompt - Whether to skip interactive prompts
|
|
@@ -275,7 +275,7 @@ class ClaudeCodeConfigManager {
|
|
|
275
275
|
opusModel: profile.defaultOpusModel
|
|
276
276
|
}, modelMode);
|
|
277
277
|
writeJsonConfig(SETTINGS_FILE, settings);
|
|
278
|
-
const { setPrimaryApiKey, addCompletedOnboarding } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
278
|
+
const { setPrimaryApiKey, addCompletedOnboarding } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
279
279
|
setPrimaryApiKey();
|
|
280
280
|
addCompletedOnboarding();
|
|
281
281
|
let verifiedSettings = readJsonConfig2(SETTINGS_FILE) || {};
|
|
@@ -327,6 +327,8 @@ class ClaudeCodeConfigManager {
|
|
|
327
327
|
name: profile.name,
|
|
328
328
|
authType: profile.authType
|
|
329
329
|
};
|
|
330
|
+
if (profile.provider)
|
|
331
|
+
sanitized.provider = profile.provider;
|
|
330
332
|
if (profile.apiKey)
|
|
331
333
|
sanitized.apiKey = profile.apiKey;
|
|
332
334
|
if (profile.baseUrl)
|
|
@@ -3,8 +3,9 @@ import { i as inquirer } from './index6.mjs';
|
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
4
4
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
5
5
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
6
|
+
import { readZcfConfig } from './ccjk-config.mjs';
|
|
6
7
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
7
|
-
import { v as validateApiKey } from '../shared/ccjk.
|
|
8
|
+
import { v as validateApiKey } from '../shared/ccjk.Dz0ssUQx.mjs';
|
|
8
9
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
9
10
|
import 'node:readline';
|
|
10
11
|
import 'stream';
|
|
@@ -26,20 +27,19 @@ import 'node:url';
|
|
|
26
27
|
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
27
28
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
28
29
|
import './constants.mjs';
|
|
29
|
-
import './ccjk-config.mjs';
|
|
30
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
31
|
-
import './index3.mjs';
|
|
32
|
-
import './fs-operations.mjs';
|
|
33
|
-
import 'node:fs/promises';
|
|
34
|
-
import './json-config.mjs';
|
|
35
30
|
import './config.mjs';
|
|
36
31
|
import './claude-config.mjs';
|
|
32
|
+
import './json-config.mjs';
|
|
33
|
+
import './fs-operations.mjs';
|
|
34
|
+
import 'node:fs/promises';
|
|
37
35
|
import './platform.mjs';
|
|
38
36
|
import './main.mjs';
|
|
39
37
|
import 'module';
|
|
40
38
|
import 'node:child_process';
|
|
41
39
|
import 'node:stream';
|
|
42
40
|
import '../shared/ccjk.DScm_NnL.mjs';
|
|
41
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
42
|
+
import './index3.mjs';
|
|
43
43
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
44
44
|
|
|
45
45
|
function getAuthTypeLabel(authType) {
|
|
@@ -55,11 +55,20 @@ function getAuthTypeLabel(authType) {
|
|
|
55
55
|
return authType;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
async function syncMyclaudeProfilesIfNeeded() {
|
|
59
|
+
const zcfConfig = readZcfConfig();
|
|
60
|
+
if (zcfConfig?.codeToolType !== "myclaude") {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const { syncMyclaudeProviderProfilesFromClaudeConfig } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
64
|
+
syncMyclaudeProviderProfilesFromClaudeConfig(ClaudeCodeConfigManager.readConfig());
|
|
65
|
+
}
|
|
58
66
|
async function configureIncrementalManagement() {
|
|
59
67
|
ensureI18nInitialized();
|
|
60
68
|
const config = ClaudeCodeConfigManager.readConfig();
|
|
61
69
|
if (!config || !config.profiles || Object.keys(config.profiles).length === 0) {
|
|
62
70
|
await handleAddProfile();
|
|
71
|
+
await syncMyclaudeProfilesIfNeeded();
|
|
63
72
|
return;
|
|
64
73
|
}
|
|
65
74
|
const profiles = Object.values(config.profiles);
|
|
@@ -100,6 +109,7 @@ async function configureIncrementalManagement() {
|
|
|
100
109
|
await handleDeleteProfile(profiles);
|
|
101
110
|
break;
|
|
102
111
|
}
|
|
112
|
+
await syncMyclaudeProfilesIfNeeded();
|
|
103
113
|
}
|
|
104
114
|
async function promptContinueAdding() {
|
|
105
115
|
return await promptBoolean({
|
|
@@ -109,7 +119,17 @@ async function promptContinueAdding() {
|
|
|
109
119
|
}
|
|
110
120
|
async function addProfileDirect() {
|
|
111
121
|
ensureI18nInitialized();
|
|
112
|
-
|
|
122
|
+
await handleAddProfile();
|
|
123
|
+
await syncMyclaudeProfilesIfNeeded();
|
|
124
|
+
}
|
|
125
|
+
function getProviderDefaultModels(provider) {
|
|
126
|
+
const defaults = provider?.claudeCode?.defaultModels || [];
|
|
127
|
+
return {
|
|
128
|
+
primaryModel: defaults[0],
|
|
129
|
+
haikuModel: defaults[1] || defaults[0],
|
|
130
|
+
sonnetModel: defaults[2] || defaults[0],
|
|
131
|
+
opusModel: defaults[3]
|
|
132
|
+
};
|
|
113
133
|
}
|
|
114
134
|
async function handleAddProfile() {
|
|
115
135
|
console.log(a.green(`
|
|
@@ -128,20 +148,18 @@ ${i18n.t("multi-config:addingNewProfile")}`));
|
|
|
128
148
|
}]);
|
|
129
149
|
let prefilledBaseUrl;
|
|
130
150
|
let prefilledAuthType;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
console.log(a.gray(i18n.t("api:providerSelected", { name: provider.name })));
|
|
137
|
-
}
|
|
151
|
+
const selectedProviderPreset = selectedProvider !== "custom" ? providers.find((p) => p.id === selectedProvider) : void 0;
|
|
152
|
+
if (selectedProviderPreset?.claudeCode) {
|
|
153
|
+
prefilledBaseUrl = selectedProviderPreset.claudeCode.baseUrl;
|
|
154
|
+
prefilledAuthType = selectedProviderPreset.claudeCode.authType;
|
|
155
|
+
console.log(a.gray(i18n.t("api:providerSelected", { name: selectedProviderPreset.name })));
|
|
138
156
|
}
|
|
139
157
|
const answers = await inquirer.prompt([
|
|
140
158
|
{
|
|
141
159
|
type: "input",
|
|
142
160
|
name: "profileName",
|
|
143
161
|
message: i18n.t("multi-config:profileNamePrompt"),
|
|
144
|
-
default:
|
|
162
|
+
default: selectedProviderPreset?.name,
|
|
145
163
|
validate: (input) => {
|
|
146
164
|
const trimmed = input.trim();
|
|
147
165
|
if (!trimmed) {
|
|
@@ -187,7 +205,7 @@ ${i18n.t("multi-config:addingNewProfile")}`));
|
|
|
187
205
|
{
|
|
188
206
|
type: "input",
|
|
189
207
|
name: "apiKey",
|
|
190
|
-
message: selectedProvider !== "custom" ? i18n.t("api:enterProviderApiKey", { provider:
|
|
208
|
+
message: selectedProvider !== "custom" ? i18n.t("api:enterProviderApiKey", { provider: selectedProviderPreset?.name || selectedProvider }) : i18n.t("multi-config:apiKeyPrompt"),
|
|
191
209
|
when: (answers2) => selectedProvider === "custom" ? answers2.authType !== "ccr_proxy" : true,
|
|
192
210
|
validate: (input) => {
|
|
193
211
|
const trimmed = input.trim();
|
|
@@ -203,9 +221,15 @@ ${i18n.t("multi-config:addingNewProfile")}`));
|
|
|
203
221
|
}
|
|
204
222
|
]);
|
|
205
223
|
let modelConfig = null;
|
|
206
|
-
|
|
224
|
+
{
|
|
207
225
|
const { promptCustomModels } = await import('./features.mjs');
|
|
208
|
-
|
|
226
|
+
const defaults = getProviderDefaultModels(selectedProviderPreset);
|
|
227
|
+
modelConfig = await promptCustomModels(
|
|
228
|
+
defaults.primaryModel,
|
|
229
|
+
defaults.haikuModel,
|
|
230
|
+
defaults.sonnetModel,
|
|
231
|
+
defaults.opusModel
|
|
232
|
+
);
|
|
209
233
|
}
|
|
210
234
|
const setAsDefault = await promptBoolean({
|
|
211
235
|
message: i18n.t("multi-config:setAsDefaultPrompt"),
|
|
@@ -216,7 +240,8 @@ ${i18n.t("multi-config:addingNewProfile")}`));
|
|
|
216
240
|
const profile = {
|
|
217
241
|
id: profileId,
|
|
218
242
|
name: profileName,
|
|
219
|
-
authType: selectedProvider === "custom" ? answers.authType : prefilledAuthType
|
|
243
|
+
authType: selectedProvider === "custom" ? answers.authType : prefilledAuthType,
|
|
244
|
+
provider: selectedProvider
|
|
220
245
|
};
|
|
221
246
|
if (profile.authType !== "ccr_proxy") {
|
|
222
247
|
profile.apiKey = answers.apiKey.trim();
|
|
@@ -253,6 +278,7 @@ ${i18n.t("multi-config:addingNewProfile")}`));
|
|
|
253
278
|
const updateResult = await ClaudeCodeConfigManager.updateProfile(existingProfile.id, {
|
|
254
279
|
name: profile.name,
|
|
255
280
|
authType: profile.authType,
|
|
281
|
+
provider: profile.provider,
|
|
256
282
|
apiKey: profile.apiKey,
|
|
257
283
|
baseUrl: profile.baseUrl,
|
|
258
284
|
primaryModel: profile.primaryModel,
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { CLAUDE_VSC_CONFIG_FILE, CLAUDE_DIR, ClAUDE_CONFIG_FILE } from './constants.mjs';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
4
4
|
import { readJsonConfig, writeJsonConfig, backupJsonConfig } from './json-config.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { i as isWindows, l as getMcpCommand } from './platform.mjs';
|
|
6
6
|
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
7
7
|
|
|
8
8
|
function mergeArraysUnique(arr1, arr2) {
|
|
@@ -200,9 +200,40 @@ function setPrimaryApiKey() {
|
|
|
200
200
|
function setMyclaudeProviderProfiles(profiles, activeProfileId) {
|
|
201
201
|
const config = readMcpConfig() || { mcpServers: {} };
|
|
202
202
|
config.myclaudeProviderProfiles = profiles;
|
|
203
|
-
config.myclaudeActiveProviderProfileId = activeProfileId
|
|
203
|
+
config.myclaudeActiveProviderProfileId = activeProfileId ?? profiles[0]?.id;
|
|
204
204
|
writeMcpConfig(config);
|
|
205
205
|
}
|
|
206
|
+
function setMyclaudeActiveProviderProfile(activeProfileId) {
|
|
207
|
+
const config = readMcpConfig() || { mcpServers: {} };
|
|
208
|
+
config.myclaudeActiveProviderProfileId = activeProfileId ?? "";
|
|
209
|
+
writeMcpConfig(config);
|
|
210
|
+
}
|
|
211
|
+
function toMyclaudeProviderProfile(profile, existing) {
|
|
212
|
+
return {
|
|
213
|
+
id: profile.id || existing?.id || profile.name,
|
|
214
|
+
name: profile.name,
|
|
215
|
+
provider: profile.provider || existing?.provider || "custom",
|
|
216
|
+
apiKey: profile.apiKey,
|
|
217
|
+
baseUrl: profile.baseUrl,
|
|
218
|
+
model: profile.primaryModel,
|
|
219
|
+
fastModel: profile.defaultHaikuModel,
|
|
220
|
+
authType: profile.authType,
|
|
221
|
+
primaryModel: profile.primaryModel,
|
|
222
|
+
defaultHaikuModel: profile.defaultHaikuModel,
|
|
223
|
+
defaultSonnetModel: profile.defaultSonnetModel,
|
|
224
|
+
defaultOpusModel: profile.defaultOpusModel
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function syncMyclaudeProviderProfilesFromClaudeConfig(configData) {
|
|
228
|
+
if (!configData) {
|
|
229
|
+
clearMyclaudeProviderProfiles();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const existingProfiles = readMcpConfig()?.myclaudeProviderProfiles || [];
|
|
233
|
+
const existingById = new Map(existingProfiles.map((profile) => [String(profile.id), profile]));
|
|
234
|
+
const profiles = Object.entries(configData.profiles).map(([id, profile]) => toMyclaudeProviderProfile({ ...profile, id }, existingById.get(id)));
|
|
235
|
+
setMyclaudeProviderProfiles(profiles, configData.currentProfileId ?? "");
|
|
236
|
+
}
|
|
206
237
|
function clearMyclaudeProviderProfiles() {
|
|
207
238
|
const config = readMcpConfig();
|
|
208
239
|
if (!config) {
|
|
@@ -244,10 +275,12 @@ const claudeConfig = {
|
|
|
244
275
|
mergeMcpServers: mergeMcpServers,
|
|
245
276
|
readMcpConfig: readMcpConfig,
|
|
246
277
|
replaceMcpServers: replaceMcpServers,
|
|
278
|
+
setMyclaudeActiveProviderProfile: setMyclaudeActiveProviderProfile,
|
|
247
279
|
setMyclaudeProviderProfiles: setMyclaudeProviderProfiles,
|
|
248
280
|
setPrimaryApiKey: setPrimaryApiKey,
|
|
249
281
|
syncMcpPermissions: syncMcpPermissions,
|
|
282
|
+
syncMyclaudeProviderProfilesFromClaudeConfig: syncMyclaudeProviderProfilesFromClaudeConfig,
|
|
250
283
|
writeMcpConfig: writeMcpConfig
|
|
251
284
|
};
|
|
252
285
|
|
|
253
|
-
export {
|
|
286
|
+
export { buildMcpServerConfig as a, backupMcpConfig as b, syncMyclaudeProviderProfilesFromClaudeConfig as c, setPrimaryApiKey as d, addCompletedOnboarding as e, fixWindowsMcpConfig as f, deepMerge as g, setMyclaudeProviderProfiles as h, clearMyclaudeProviderProfiles as i, replaceMcpServers as j, syncMcpPermissions as k, claudeConfig as l, mergeMcpServers as m, readMcpConfig as r, setMyclaudeActiveProviderProfile as s, writeMcpConfig as w };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
2
|
import { exec as q } from './main.mjs';
|
|
3
3
|
import { i18n, initI18n } from './index2.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { k as findRealCommandPath } from './platform.mjs';
|
|
5
5
|
import 'module';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:path';
|
package/dist/chunks/cli-hook.mjs
CHANGED
|
@@ -2802,7 +2802,7 @@ class AutoExecutor extends EventEmitter {
|
|
|
2802
2802
|
};
|
|
2803
2803
|
}
|
|
2804
2804
|
/**
|
|
2805
|
-
* Execute user request
|
|
2805
|
+
* Execute a user request after a router has selected this executor.
|
|
2806
2806
|
*/
|
|
2807
2807
|
async execute(userInput) {
|
|
2808
2808
|
const executionId = `exec-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -3578,7 +3578,7 @@ class CliInterceptor extends EventEmitter {
|
|
|
3578
3578
|
};
|
|
3579
3579
|
}
|
|
3580
3580
|
/**
|
|
3581
|
-
* Intercept user input
|
|
3581
|
+
* Intercept user input when this component is explicitly integrated.
|
|
3582
3582
|
*/
|
|
3583
3583
|
async intercept(userInput) {
|
|
3584
3584
|
if (!this.config.enabled) {
|
|
@@ -3646,9 +3646,8 @@ class CliInterceptor extends EventEmitter {
|
|
|
3646
3646
|
* Show intent message to user
|
|
3647
3647
|
*/
|
|
3648
3648
|
showIntentMessage(_input) {
|
|
3649
|
-
console.log("\n\u{1F9E0}
|
|
3650
|
-
console.log("
|
|
3651
|
-
console.log(" Smart mode: ambiguity checks + capability-ranked tool selection + telemetry\n");
|
|
3649
|
+
console.log("\n\u{1F9E0} Brain router is handling this request...");
|
|
3650
|
+
console.log(" It may use skills, agents, and MCP tools based on the active routing config.\n");
|
|
3652
3651
|
}
|
|
3653
3652
|
async handleBypassedCommand(input, reason) {
|
|
3654
3653
|
const normalized = input.trim().toLowerCase();
|
|
@@ -45,6 +45,7 @@ import './platform.mjs';
|
|
|
45
45
|
import '../shared/ccjk.DScm_NnL.mjs';
|
|
46
46
|
import './prompts.mjs';
|
|
47
47
|
import '../shared/ccjk.gDEDGD_t.mjs';
|
|
48
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
48
49
|
|
|
49
50
|
async function configureIncrementalManagement() {
|
|
50
51
|
ensureI18nInitialized();
|
|
@@ -193,7 +194,7 @@ async function handleAddProvider() {
|
|
|
193
194
|
defaultValue: true
|
|
194
195
|
});
|
|
195
196
|
if (setAsDefault) {
|
|
196
|
-
const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.
|
|
197
|
+
const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.q; });
|
|
197
198
|
const switched = await switchToProvider(provider.id);
|
|
198
199
|
if (switched) {
|
|
199
200
|
console.log(a.green(i18n.t("multi-config:profileSetAsDefault", { name: provider.name })));
|
|
@@ -388,7 +389,7 @@ ${i18n.t("codex:copyingProvider", { name: provider.name })}`));
|
|
|
388
389
|
defaultValue: false
|
|
389
390
|
});
|
|
390
391
|
if (setAsDefault) {
|
|
391
|
-
const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.
|
|
392
|
+
const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.q; });
|
|
392
393
|
const switched = await switchToProvider(copiedProvider.id);
|
|
393
394
|
if (switched) {
|
|
394
395
|
console.log(a.green(i18n.t("multi-config:profileSetAsDefault", { name: copiedProvider.name })));
|
|
@@ -44,6 +44,7 @@ import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
|
44
44
|
import './prompts.mjs';
|
|
45
45
|
import '../shared/ccjk.gDEDGD_t.mjs';
|
|
46
46
|
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
47
|
+
import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
47
48
|
|
|
48
49
|
async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
|
|
49
50
|
ensureI18nInitialized();
|