ccjk 13.6.4 → 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/agents.mjs +1 -1
- 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 +6 -4
- package/dist/chunks/check-updates.mjs +28 -17
- 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 +52 -2
- package/dist/chunks/claude-wrapper.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +25 -83
- 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 +179 -3
- package/dist/chunks/doctor.mjs +1 -1
- package/dist/chunks/features.mjs +76 -11
- package/dist/chunks/index10.mjs +55 -36
- package/dist/chunks/init.mjs +120 -61
- package/dist/chunks/installer.mjs +80 -19
- 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 +5 -1
- package/dist/chunks/quick-setup.mjs +13 -11
- package/dist/chunks/research.mjs +1177 -0
- package/dist/chunks/sessions.mjs +1 -1
- package/dist/chunks/smart-defaults.mjs +42 -14
- package/dist/chunks/uninstall.mjs +2 -2
- package/dist/chunks/update.mjs +14 -13
- package/dist/chunks/version-checker.mjs +11 -1
- package/dist/cli.mjs +32 -0
- 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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -174
- package/dist/shared/{ccjk.DvAP4XfP.mjs → ccjk.B4aXNclK.mjs} +2 -2
- package/dist/shared/ccjk.BI-hdI7P.mjs +30 -0
- package/dist/shared/{ccjk.DwSebGy0.mjs → ccjk.BOO14f66.mjs} +1 -1
- package/dist/shared/ccjk.BnsY5WxD.mjs +171 -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/dist/shared/ccjk.yYQMbHH3.mjs +115 -0
- package/package.json +70 -65
- package/templates/common/workflow/essential/en/feat.md +68 -291
- package/templates/common/workflow/sixStep/en/workflow.md +56 -330
- package/dist/shared/ccjk.CiKtBUW_.mjs +0 -54
package/dist/chunks/init.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import process__default from 'node:process';
|
|
3
3
|
import a from './index5.mjs';
|
|
4
4
|
import { i as inquirer } from './index6.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import { SETTINGS_FILE, API_DEFAULT_URL, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS } from './constants.mjs';
|
|
5
|
+
import { M as MCP_SERVICE_CONFIGS, g as getMcpServices } from '../shared/ccjk.DKXs7Fbm.mjs';
|
|
6
|
+
import { SETTINGS_FILE, API_DEFAULT_URL, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS, isClaudeFamilyCodeTool, CODE_TOOL_INFO } from './constants.mjs';
|
|
7
7
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
8
8
|
import { displayBannerWithInfo, padToDisplayWidth } from './banner.mjs';
|
|
9
9
|
import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
|
|
@@ -11,16 +11,18 @@ import { readCcrConfig, backupCcrConfig, createDefaultCcrConfig, writeCcrConfig,
|
|
|
11
11
|
import { exec } from 'node:child_process';
|
|
12
12
|
import { promisify } from 'node:util';
|
|
13
13
|
import { updateCcr } from './auto-updater.mjs';
|
|
14
|
-
import { w as wrapCommandWithSudo,
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { w as wrapCommandWithSudo, i as isWindows, b as isTermux } from './platform.mjs';
|
|
15
|
+
import { h as setMyclaudeProviderProfiles, e as addCompletedOnboarding, d as setPrimaryApiKey, i as clearMyclaudeProviderProfiles, b as backupMcpConfig, a as buildMcpServerConfig, r as readMcpConfig, j as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, k as syncMcpPermissions } from './claude-config.mjs';
|
|
16
|
+
import { h as runCodexFullInit } from './codex.mjs';
|
|
17
|
+
import { a as resolveStartupCodeType, r as resolveCodeType } from '../shared/ccjk.yYQMbHH3.mjs';
|
|
17
18
|
import { exists } from './fs-operations.mjs';
|
|
18
19
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
19
20
|
import { p as promptApiConfigurationAction, i as ensureClaudeDir, d as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, f as copyConfigFiles, h as applyAiLanguageDirective, e as configureApi } from './config.mjs';
|
|
20
21
|
import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration } from '../shared/ccjk.DDq2hqA5.mjs';
|
|
21
|
-
import { m as modifyApiConfigPartially,
|
|
22
|
+
import { m as modifyApiConfigPartially, a as configureApiCompletely, c as configureOutputStyle, f as formatApiKeyDisplay } from '../shared/ccjk.Dz0ssUQx.mjs';
|
|
22
23
|
import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
|
|
23
|
-
import { getInstallationStatus, installClaudeCode } from './installer.mjs';
|
|
24
|
+
import { getInstallationStatus, installMyclaude, installClaudeCode } from './installer.mjs';
|
|
25
|
+
import { s as selectMcpServices } from '../shared/ccjk.BI-hdI7P.mjs';
|
|
24
26
|
import { p as parseOrchestrationLevel, w as writeOrchestrationPolicy } from './smart-defaults.mjs';
|
|
25
27
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
26
28
|
import { resolveAiOutputLanguage } from './prompts.mjs';
|
|
@@ -97,30 +99,6 @@ async function installCcr() {
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
async function selectMcpServices() {
|
|
101
|
-
ensureI18nInitialized();
|
|
102
|
-
const mcpServices = await getMcpServices();
|
|
103
|
-
const defaultSelectedIds = new Set(
|
|
104
|
-
MCP_SERVICE_CONFIGS.filter((c) => c.defaultSelected).map((c) => c.id)
|
|
105
|
-
);
|
|
106
|
-
const choices = mcpServices.map((service) => ({
|
|
107
|
-
name: `${service.name} - ${a.gray(service.description)}`,
|
|
108
|
-
value: service.id,
|
|
109
|
-
checked: defaultSelectedIds.has(service.id)
|
|
110
|
-
}));
|
|
111
|
-
const { services } = await inquirer.prompt({
|
|
112
|
-
type: "checkbox",
|
|
113
|
-
name: "services",
|
|
114
|
-
message: `${i18n.t("mcp:selectMcpServices")}${i18n.t("common:multiSelectHint")}`,
|
|
115
|
-
choices
|
|
116
|
-
});
|
|
117
|
-
if (services === void 0) {
|
|
118
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
119
|
-
return void 0;
|
|
120
|
-
}
|
|
121
|
-
return services;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
102
|
const COMETIX_PACKAGE_NAME = "@cometix/ccline";
|
|
125
103
|
const COMETIX_COMMAND_NAME = "ccline";
|
|
126
104
|
const COMETIX_COMMANDS = {
|
|
@@ -740,6 +718,8 @@ async function handleMultiConfigurations(options, codeToolType) {
|
|
|
740
718
|
await validateApiConfigs(configs);
|
|
741
719
|
if (codeToolType === "claude-code") {
|
|
742
720
|
await handleClaudeCodeConfigs(configs);
|
|
721
|
+
} else if (codeToolType === "myclaude") {
|
|
722
|
+
await handleMyclaudeConfigs(configs);
|
|
743
723
|
} else if (codeToolType === "codex") {
|
|
744
724
|
await handleCodexConfigs(configs);
|
|
745
725
|
}
|
|
@@ -824,6 +804,13 @@ async function handleClaudeCodeConfigs(configs) {
|
|
|
824
804
|
}
|
|
825
805
|
await ClaudeCodeConfigManager.syncCcrProfile();
|
|
826
806
|
}
|
|
807
|
+
async function handleMyclaudeConfigs(configs) {
|
|
808
|
+
const profiles = await Promise.all(configs.map((config) => convertToMyclaudeProviderProfile(config)));
|
|
809
|
+
const activeProfile = profiles.find((_, index) => configs[index]?.default) || profiles[0];
|
|
810
|
+
setMyclaudeProviderProfiles(profiles, activeProfile?.id);
|
|
811
|
+
const summary = profiles.map((profile) => `${profile.name} [${profile.provider}]`).join(", ");
|
|
812
|
+
console.log(a.gray(` \u2022 ~/.claude.json: ${summary}`));
|
|
813
|
+
}
|
|
827
814
|
async function handleCodexConfigs(configs) {
|
|
828
815
|
const { addProviderToExisting } = await import('./codex-provider-manager.mjs');
|
|
829
816
|
const addedProviderIds = [];
|
|
@@ -852,7 +839,7 @@ async function handleCodexConfigs(configs) {
|
|
|
852
839
|
}
|
|
853
840
|
const defaultConfig = configs.find((c) => c.default);
|
|
854
841
|
if (defaultConfig) {
|
|
855
|
-
const { switchCodexProvider } = await import('./codex.mjs').then(function (n) { return n.
|
|
842
|
+
const { switchCodexProvider } = await import('./codex.mjs').then(function (n) { return n.q; });
|
|
856
843
|
const displayName = defaultConfig.name || defaultConfig.provider || "custom";
|
|
857
844
|
const providerId = displayName.toLowerCase().replace(/[^a-z0-9]/g, "-");
|
|
858
845
|
if (addedProviderIds.includes(providerId)) {
|
|
@@ -921,6 +908,7 @@ async function buildClaudeCodeProfile(params) {
|
|
|
921
908
|
return {
|
|
922
909
|
name: params.name,
|
|
923
910
|
authType,
|
|
911
|
+
provider: params.provider || "custom",
|
|
924
912
|
apiKey: params.key,
|
|
925
913
|
baseUrl,
|
|
926
914
|
primaryModel,
|
|
@@ -956,6 +944,23 @@ async function convertToClaudeCodeProfile(config) {
|
|
|
956
944
|
defaultOpusModel: config.defaultOpusModel
|
|
957
945
|
});
|
|
958
946
|
}
|
|
947
|
+
async function convertToMyclaudeProviderProfile(config) {
|
|
948
|
+
const claudeProfile = await convertToClaudeCodeProfile(config);
|
|
949
|
+
return {
|
|
950
|
+
id: claudeProfile.id || claudeProfile.name,
|
|
951
|
+
name: claudeProfile.name,
|
|
952
|
+
provider: config.provider || "custom",
|
|
953
|
+
apiKey: claudeProfile.apiKey,
|
|
954
|
+
baseUrl: claudeProfile.baseUrl,
|
|
955
|
+
model: claudeProfile.primaryModel,
|
|
956
|
+
fastModel: claudeProfile.defaultHaikuModel,
|
|
957
|
+
authType: claudeProfile.authType,
|
|
958
|
+
primaryModel: claudeProfile.primaryModel,
|
|
959
|
+
defaultHaikuModel: claudeProfile.defaultHaikuModel,
|
|
960
|
+
defaultSonnetModel: claudeProfile.defaultSonnetModel,
|
|
961
|
+
defaultOpusModel: claudeProfile.defaultOpusModel
|
|
962
|
+
};
|
|
963
|
+
}
|
|
959
964
|
async function convertToCodexProvider(config) {
|
|
960
965
|
const displayName = config.name || config.provider || "custom";
|
|
961
966
|
const providerId = displayName.toLowerCase().replace(/[^a-z0-9]/g, "-");
|
|
@@ -1022,11 +1027,14 @@ async function init(options = {}) {
|
|
|
1022
1027
|
tracker.nextStep();
|
|
1023
1028
|
let codeToolType;
|
|
1024
1029
|
try {
|
|
1025
|
-
codeToolType = await
|
|
1030
|
+
codeToolType = await resolveStartupCodeType({
|
|
1031
|
+
codeTypeParam: options.codeType,
|
|
1032
|
+
interactive: !options.skipPrompt
|
|
1033
|
+
});
|
|
1026
1034
|
} catch (error) {
|
|
1027
1035
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1028
1036
|
console.error(a.red(`${i18n.t("errors:generalError")} ${errorMessage}`));
|
|
1029
|
-
codeToolType = DEFAULT_CODE_TOOL_TYPE;
|
|
1037
|
+
codeToolType = await resolveCodeType(options.codeType).catch(() => DEFAULT_CODE_TOOL_TYPE);
|
|
1030
1038
|
}
|
|
1031
1039
|
options.codeType = codeToolType;
|
|
1032
1040
|
async function selectApiConfigurationMode() {
|
|
@@ -1056,7 +1064,7 @@ async function init(options = {}) {
|
|
|
1056
1064
|
return apiMode;
|
|
1057
1065
|
}
|
|
1058
1066
|
async function handleCustomApiConfiguration(existingConfig) {
|
|
1059
|
-
if (codeToolType === "claude-code") {
|
|
1067
|
+
if (codeToolType === "claude-code" || codeToolType === "myclaude") {
|
|
1060
1068
|
const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
|
|
1061
1069
|
await configureIncrementalManagement();
|
|
1062
1070
|
return null;
|
|
@@ -1186,36 +1194,48 @@ async function init(options = {}) {
|
|
|
1186
1194
|
zcfConfig,
|
|
1187
1195
|
options.skipPrompt
|
|
1188
1196
|
);
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1197
|
+
const installerCodeType = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
|
|
1198
|
+
const installationStatus = await getInstallationStatus(installerCodeType);
|
|
1199
|
+
const codeToolName = CODE_TOOL_INFO[codeToolType].name;
|
|
1200
|
+
if (isClaudeFamilyCodeTool(codeToolType)) {
|
|
1201
|
+
if (installationStatus.hasGlobal) {
|
|
1202
|
+
const { verifyInstallation, displayVerificationResult } = await import('./installer.mjs');
|
|
1203
|
+
const verification = await verifyInstallation(installerCodeType);
|
|
1204
|
+
if (verification.symlinkCreated) {
|
|
1205
|
+
console.log(a.green(`\u2714 ${codeToolName} ${i18n.t("installation:alreadyInstalled")}`));
|
|
1206
|
+
displayVerificationResult(verification, installerCodeType);
|
|
1207
|
+
} else if (!verification.success) {
|
|
1208
|
+
console.log(a.yellow(`\u26A0 ${i18n.t("installation:verificationFailed")}`));
|
|
1209
|
+
if (verification.error) {
|
|
1210
|
+
console.log(a.gray(` ${verification.error}`));
|
|
1211
|
+
}
|
|
1200
1212
|
}
|
|
1201
|
-
}
|
|
1202
|
-
} else {
|
|
1203
|
-
if (options.skipPrompt) {
|
|
1204
|
-
await installClaudeCode(true);
|
|
1205
1213
|
} else {
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1214
|
+
if (options.skipPrompt) {
|
|
1215
|
+
if (codeToolType === "myclaude") {
|
|
1216
|
+
await installMyclaude(true);
|
|
1217
|
+
} else {
|
|
1218
|
+
await installClaudeCode(true);
|
|
1219
|
+
}
|
|
1212
1220
|
} else {
|
|
1213
|
-
|
|
1221
|
+
const shouldInstall = await promptBoolean({
|
|
1222
|
+
message: i18n.t("installation:installPrompt"),
|
|
1223
|
+
defaultValue: true
|
|
1224
|
+
});
|
|
1225
|
+
if (shouldInstall) {
|
|
1226
|
+
if (codeToolType === "myclaude") {
|
|
1227
|
+
await installMyclaude(false);
|
|
1228
|
+
} else {
|
|
1229
|
+
await installClaudeCode(false);
|
|
1230
|
+
}
|
|
1231
|
+
} else {
|
|
1232
|
+
console.log(a.yellow(i18n.t("common:skip")));
|
|
1233
|
+
}
|
|
1214
1234
|
}
|
|
1215
1235
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1236
|
+
if (installationStatus.hasGlobal && codeToolType === "claude-code") {
|
|
1237
|
+
await checkClaudeCodeVersionAndPrompt(options.skipPrompt);
|
|
1238
|
+
}
|
|
1219
1239
|
}
|
|
1220
1240
|
ensureClaudeDir();
|
|
1221
1241
|
if (existsSync(SETTINGS_FILE) && needsMigration()) {
|
|
@@ -1317,6 +1337,9 @@ async function init(options = {}) {
|
|
|
1317
1337
|
if (options.apiConfigs || options.apiConfigsFile) {
|
|
1318
1338
|
await handleMultiConfigurations(options, codeToolType);
|
|
1319
1339
|
apiConfig = null;
|
|
1340
|
+
if (codeToolType === "claude-code") {
|
|
1341
|
+
clearMyclaudeProviderProfiles();
|
|
1342
|
+
}
|
|
1320
1343
|
} else if (options.provider && options.apiKey) {
|
|
1321
1344
|
const { getProviderPreset } = await import('./api-providers.mjs');
|
|
1322
1345
|
const preset = options.provider !== "custom" ? getProviderPreset(options.provider) : null;
|
|
@@ -1445,10 +1468,46 @@ async function init(options = {}) {
|
|
|
1445
1468
|
console.log(a.green(`\u2714 ${i18n.t("api:apiConfigSuccess")}`));
|
|
1446
1469
|
console.log(a.gray(` URL: ${configuredApi.url}`));
|
|
1447
1470
|
console.log(a.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
|
|
1471
|
+
if (codeToolType === "myclaude") {
|
|
1472
|
+
try {
|
|
1473
|
+
if (!configuredApi.authType) {
|
|
1474
|
+
throw new Error("Configured API is missing authType");
|
|
1475
|
+
}
|
|
1476
|
+
const profile = await convertSingleConfigToProfile(
|
|
1477
|
+
{
|
|
1478
|
+
authType: configuredApi.authType,
|
|
1479
|
+
key: configuredApi.key,
|
|
1480
|
+
url: configuredApi.url
|
|
1481
|
+
},
|
|
1482
|
+
options.provider,
|
|
1483
|
+
{
|
|
1484
|
+
apiModel: options.apiModel,
|
|
1485
|
+
apiHaikuModel: options.apiHaikuModel,
|
|
1486
|
+
apiSonnetModel: options.apiSonnetModel,
|
|
1487
|
+
apiOpusModel: options.apiOpusModel
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
setMyclaudeProviderProfiles([
|
|
1491
|
+
{
|
|
1492
|
+
id: profile.id || profile.name,
|
|
1493
|
+
name: profile.name,
|
|
1494
|
+
provider: options.provider || "custom",
|
|
1495
|
+
apiKey: profile.apiKey,
|
|
1496
|
+
baseUrl: profile.baseUrl,
|
|
1497
|
+
model: profile.primaryModel,
|
|
1498
|
+
fastModel: profile.defaultHaikuModel
|
|
1499
|
+
}
|
|
1500
|
+
], profile.id || profile.name);
|
|
1501
|
+
} catch (error) {
|
|
1502
|
+
console.log(a.yellow(`\u26A0 Failed to write myclaude provider profile: ${error}`));
|
|
1503
|
+
}
|
|
1504
|
+
} else if (codeToolType === "claude-code") {
|
|
1505
|
+
clearMyclaudeProviderProfiles();
|
|
1506
|
+
}
|
|
1448
1507
|
}
|
|
1449
1508
|
}
|
|
1450
1509
|
const hasModelParams = options.apiModel || options.apiHaikuModel || options.apiSonnetModel || options.apiOpusModel;
|
|
1451
|
-
if (hasModelParams && action !== "docs-only" && codeToolType === "claude-code") {
|
|
1510
|
+
if (hasModelParams && action !== "docs-only" && (codeToolType === "claude-code" || codeToolType === "myclaude")) {
|
|
1452
1511
|
if (options.skipPrompt) {
|
|
1453
1512
|
const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.j; });
|
|
1454
1513
|
updateCustomModel(
|
|
@@ -5,10 +5,11 @@ import a from './index5.mjs';
|
|
|
5
5
|
import { i as inquirer } from './index6.mjs';
|
|
6
6
|
import ora from './index8.mjs';
|
|
7
7
|
import { exec as q } from './main.mjs';
|
|
8
|
+
import { getCodeToolRuntimeCommand, CODE_TOOL_INFO, isClaudeFamilyCodeTool } from './constants.mjs';
|
|
8
9
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
9
10
|
import { updateClaudeCode } from './auto-updater.mjs';
|
|
10
11
|
import { exists } from './fs-operations.mjs';
|
|
11
|
-
import { f as findCommandPath, g as getPlatform, a as getHomebrewCommandPaths,
|
|
12
|
+
import { f as findCommandPath, g as getPlatform, a as getHomebrewCommandPaths, b as isTermux, c as getTermuxPrefix, w as wrapCommandWithSudo, d as isWSL, e as getWSLInfo, h as commandExists, j as getRecommendedInstallMethods } from './platform.mjs';
|
|
12
13
|
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
13
14
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
14
15
|
import 'node:readline';
|
|
@@ -123,6 +124,48 @@ Claude Code installed to: ${getTermuxPrefix()}/bin/claude`));
|
|
|
123
124
|
${i18n.t("installation:wslInstallSuccess")}`));
|
|
124
125
|
}
|
|
125
126
|
}
|
|
127
|
+
async function isMyclaudeInstalled() {
|
|
128
|
+
return await commandExists("myclaude");
|
|
129
|
+
}
|
|
130
|
+
async function installMyclaude(skipMethodSelection = false) {
|
|
131
|
+
ensureI18nInitialized();
|
|
132
|
+
const codeType = "myclaude";
|
|
133
|
+
const codeTypeName = CODE_TOOL_INFO.myclaude.name;
|
|
134
|
+
const installed = await isMyclaudeInstalled();
|
|
135
|
+
if (installed) {
|
|
136
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:alreadyInstalled")}`));
|
|
137
|
+
const version = await detectInstalledVersion(codeType);
|
|
138
|
+
if (version) {
|
|
139
|
+
console.log(a.gray(` ${i18n.t("installation:detectedVersion", { version })}`));
|
|
140
|
+
}
|
|
141
|
+
const verification = await verifyInstallation(codeType);
|
|
142
|
+
displayVerificationResult(verification, codeType);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (skipMethodSelection) {
|
|
146
|
+
console.log(i18n.t("installation:installingWith", { method: "npm", codeType: codeTypeName }));
|
|
147
|
+
try {
|
|
148
|
+
const { command, args, usedSudo } = wrapCommandWithSudo("npm", ["install", "-g", "myclaude-code", "--force"]);
|
|
149
|
+
if (usedSudo) {
|
|
150
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
|
|
151
|
+
}
|
|
152
|
+
await q(command, args);
|
|
153
|
+
await q("myclaude", ["install", "--force"]);
|
|
154
|
+
await setInstallMethod("npm", codeType);
|
|
155
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:installSuccess")}`));
|
|
156
|
+
const verification = await verifyInstallation(codeType);
|
|
157
|
+
displayVerificationResult(verification, codeType);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error(a.red(`\u2716 ${codeTypeName} ${i18n.t("installation:installFailed")}`));
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const success = await executeInstallMethod("npm", codeType);
|
|
165
|
+
if (!success) {
|
|
166
|
+
throw new Error(i18n.t("installation:installFailed"));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
126
169
|
async function isCodexInstalled() {
|
|
127
170
|
return await commandExists("codex");
|
|
128
171
|
}
|
|
@@ -170,19 +213,18 @@ async function installCodex(skipMethodSelection = false) {
|
|
|
170
213
|
}
|
|
171
214
|
}
|
|
172
215
|
}
|
|
173
|
-
async function getInstallationStatus() {
|
|
174
|
-
const hasGlobal = await isClaudeCodeInstalled();
|
|
216
|
+
async function getInstallationStatus(codeType = "claude-code") {
|
|
217
|
+
const hasGlobal = codeType === "claude-code" ? await isClaudeCodeInstalled() : codeType === "myclaude" ? await isMyclaudeInstalled() : await isCodexInstalled();
|
|
175
218
|
return {
|
|
176
219
|
hasGlobal,
|
|
177
|
-
// Local installation was never implemented - these are kept for backward compatibility
|
|
178
220
|
hasLocal: false,
|
|
179
221
|
localPath: ""
|
|
180
222
|
};
|
|
181
223
|
}
|
|
182
224
|
async function getInstallMethodFromConfig(codeType) {
|
|
183
225
|
try {
|
|
184
|
-
if (codeType
|
|
185
|
-
const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
226
|
+
if (isClaudeFamilyCodeTool(codeType)) {
|
|
227
|
+
const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
186
228
|
const config = readMcpConfig();
|
|
187
229
|
return config?.installMethod || null;
|
|
188
230
|
}
|
|
@@ -192,7 +234,7 @@ async function getInstallMethodFromConfig(codeType) {
|
|
|
192
234
|
}
|
|
193
235
|
async function uninstallCodeTool(codeType) {
|
|
194
236
|
ensureI18nInitialized();
|
|
195
|
-
const codeTypeName = codeType
|
|
237
|
+
const codeTypeName = CODE_TOOL_INFO[codeType]?.name || codeType;
|
|
196
238
|
let method = await getInstallMethodFromConfig(codeType);
|
|
197
239
|
if (!method) {
|
|
198
240
|
if (codeType === "claude-code") {
|
|
@@ -203,6 +245,14 @@ async function uninstallCodeTool(codeType) {
|
|
|
203
245
|
}
|
|
204
246
|
} catch {
|
|
205
247
|
}
|
|
248
|
+
} else if (codeType === "myclaude") {
|
|
249
|
+
try {
|
|
250
|
+
const result = await q("brew", ["list", "--cask", "myclaude-code"]);
|
|
251
|
+
if (result.exitCode === 0) {
|
|
252
|
+
method = "homebrew";
|
|
253
|
+
}
|
|
254
|
+
} catch {
|
|
255
|
+
}
|
|
206
256
|
} else if (codeType === "codex") {
|
|
207
257
|
try {
|
|
208
258
|
const result = await q("brew", ["list", "--cask", "codex"]);
|
|
@@ -220,7 +270,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
220
270
|
const platform = getPlatform();
|
|
221
271
|
if (platform === "macos" || platform === "linux") {
|
|
222
272
|
try {
|
|
223
|
-
const testResult = codeType === "claude-code" ? await q("brew", ["list", "--cask", "claude-code"]) : await q("brew", ["list", "--cask", "codex"]);
|
|
273
|
+
const testResult = codeType === "claude-code" ? await q("brew", ["list", "--cask", "claude-code"]) : codeType === "myclaude" ? await q("brew", ["list", "--cask", "myclaude-code"]) : await q("brew", ["list", "--cask", "codex"]);
|
|
224
274
|
if (testResult.exitCode === 0) {
|
|
225
275
|
method = "homebrew";
|
|
226
276
|
}
|
|
@@ -236,7 +286,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
236
286
|
switch (method) {
|
|
237
287
|
case "npm":
|
|
238
288
|
case "npm-global": {
|
|
239
|
-
const packageName = codeType === "claude-code" ? "@anthropic-ai/claude-code" : "@openai/codex";
|
|
289
|
+
const packageName = codeType === "claude-code" ? "@anthropic-ai/claude-code" : codeType === "myclaude" ? "myclaude-code" : "@openai/codex";
|
|
240
290
|
const { command, args, usedSudo } = wrapCommandWithSudo("npm", ["uninstall", "-g", packageName]);
|
|
241
291
|
if (usedSudo) {
|
|
242
292
|
spinner.info(i18n.t("installation:usingSudo"));
|
|
@@ -248,6 +298,8 @@ async function uninstallCodeTool(codeType) {
|
|
|
248
298
|
case "homebrew": {
|
|
249
299
|
if (codeType === "claude-code") {
|
|
250
300
|
await q("brew", ["uninstall", "--cask", "claude-code"]);
|
|
301
|
+
} else if (codeType === "myclaude") {
|
|
302
|
+
await q("brew", ["uninstall", "--cask", "myclaude-code"]);
|
|
251
303
|
} else {
|
|
252
304
|
await q("brew", ["uninstall", "--cask", "codex"]);
|
|
253
305
|
}
|
|
@@ -256,7 +308,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
256
308
|
case "manual":
|
|
257
309
|
default: {
|
|
258
310
|
spinner.warn(i18n.t("installation:manualUninstallRequired", { codeType: codeTypeName }));
|
|
259
|
-
const command = codeType
|
|
311
|
+
const command = getCodeToolRuntimeCommand(codeType);
|
|
260
312
|
try {
|
|
261
313
|
const whichCmd = getPlatform() === "windows" ? "where" : "which";
|
|
262
314
|
const result = await q(whichCmd, [command]);
|
|
@@ -295,8 +347,8 @@ async function uninstallCodeTool(codeType) {
|
|
|
295
347
|
}
|
|
296
348
|
async function setInstallMethod(method, codeType = "claude-code") {
|
|
297
349
|
try {
|
|
298
|
-
if (codeType
|
|
299
|
-
const { readMcpConfig, writeMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
350
|
+
if (isClaudeFamilyCodeTool(codeType)) {
|
|
351
|
+
const { readMcpConfig, writeMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
300
352
|
let config = readMcpConfig();
|
|
301
353
|
if (!config) {
|
|
302
354
|
config = { mcpServers: {} };
|
|
@@ -310,7 +362,7 @@ async function setInstallMethod(method, codeType = "claude-code") {
|
|
|
310
362
|
}
|
|
311
363
|
async function detectInstalledVersion(codeType) {
|
|
312
364
|
try {
|
|
313
|
-
const command = codeType
|
|
365
|
+
const command = getCodeToolRuntimeCommand(codeType);
|
|
314
366
|
const result = await q(command, ["--version"]);
|
|
315
367
|
if (result.exitCode === 0 && result.stdout) {
|
|
316
368
|
const versionMatch = result.stdout.match(/(\d+\.\d+\.\d+)/);
|
|
@@ -343,6 +395,9 @@ function getInstallMethodOptions(codeType, recommendedMethods) {
|
|
|
343
395
|
if (codeType === "codex" && !["npm", "homebrew"].includes(method)) {
|
|
344
396
|
return false;
|
|
345
397
|
}
|
|
398
|
+
if (codeType === "myclaude" && method !== "npm") {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
346
401
|
if (method === "homebrew")
|
|
347
402
|
return platform === "macos" || platform === "linux";
|
|
348
403
|
if (method === "curl")
|
|
@@ -364,7 +419,7 @@ function getInstallMethodOptions(codeType, recommendedMethods) {
|
|
|
364
419
|
}
|
|
365
420
|
async function selectInstallMethod(codeType, excludeMethods = []) {
|
|
366
421
|
ensureI18nInitialized();
|
|
367
|
-
const codeTypeName = codeType
|
|
422
|
+
const codeTypeName = CODE_TOOL_INFO[codeType]?.name || codeType;
|
|
368
423
|
const recommendedMethods = getRecommendedInstallMethods(codeType);
|
|
369
424
|
const methodOptions = getInstallMethodOptions(codeType, recommendedMethods).filter((option) => !excludeMethods.includes(option.value));
|
|
370
425
|
if (methodOptions.length === 0) {
|
|
@@ -384,24 +439,30 @@ async function selectInstallMethod(codeType, excludeMethods = []) {
|
|
|
384
439
|
}
|
|
385
440
|
async function executeInstallMethod(method, codeType) {
|
|
386
441
|
ensureI18nInitialized();
|
|
387
|
-
const codeTypeName = codeType
|
|
442
|
+
const codeTypeName = CODE_TOOL_INFO[codeType]?.name || codeType;
|
|
388
443
|
const spinner = ora(i18n.t("installation:installingWith", { method, codeType: codeTypeName })).start();
|
|
389
444
|
try {
|
|
390
445
|
switch (method) {
|
|
391
446
|
case "npm": {
|
|
392
|
-
const packageName = codeType === "claude-code" ? "@anthropic-ai/claude-code" : "@openai/codex";
|
|
447
|
+
const packageName = codeType === "claude-code" ? "@anthropic-ai/claude-code" : codeType === "myclaude" ? "myclaude-code" : "@openai/codex";
|
|
393
448
|
const { command, args, usedSudo } = wrapCommandWithSudo("npm", ["install", "-g", packageName, "--force"]);
|
|
394
449
|
if (usedSudo) {
|
|
395
450
|
spinner.info(i18n.t("installation:usingSudo"));
|
|
396
451
|
spinner.start();
|
|
397
452
|
}
|
|
398
453
|
await q(command, args);
|
|
454
|
+
if (codeType === "myclaude") {
|
|
455
|
+
await q("myclaude", ["install", "--force"]);
|
|
456
|
+
}
|
|
399
457
|
await setInstallMethod("npm", codeType);
|
|
400
458
|
break;
|
|
401
459
|
}
|
|
402
460
|
case "homebrew": {
|
|
403
461
|
if (codeType === "claude-code") {
|
|
404
462
|
await q("brew", ["install", "--cask", "claude-code"]);
|
|
463
|
+
} else if (codeType === "myclaude") {
|
|
464
|
+
spinner.stop();
|
|
465
|
+
return await executeInstallMethod("npm", codeType);
|
|
405
466
|
} else {
|
|
406
467
|
await q("brew", ["install", "--cask", "codex"]);
|
|
407
468
|
}
|
|
@@ -484,7 +545,7 @@ async function isCommandInPath(command) {
|
|
|
484
545
|
}
|
|
485
546
|
}
|
|
486
547
|
async function verifyInstallation(codeType) {
|
|
487
|
-
const command = codeType
|
|
548
|
+
const command = getCodeToolRuntimeCommand(codeType);
|
|
488
549
|
const commandInPath = await isCommandInPath(command);
|
|
489
550
|
if (commandInPath) {
|
|
490
551
|
const version = await detectInstalledVersion(codeType);
|
|
@@ -654,7 +715,7 @@ async function createHomebrewSymlink(command, sourcePath) {
|
|
|
654
715
|
}
|
|
655
716
|
function displayVerificationResult(result, codeType) {
|
|
656
717
|
ensureI18nInitialized();
|
|
657
|
-
const codeTypeName = codeType
|
|
718
|
+
const codeTypeName = CODE_TOOL_INFO[codeType]?.name || codeType;
|
|
658
719
|
if (result.success) {
|
|
659
720
|
if (result.symlinkCreated) {
|
|
660
721
|
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:verificationSuccess")}`));
|
|
@@ -688,4 +749,4 @@ function displayVerificationResult(result, codeType) {
|
|
|
688
749
|
}
|
|
689
750
|
}
|
|
690
751
|
|
|
691
|
-
export { createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, executeInstallMethod, getInstallationStatus, handleInstallFailure, installClaudeCode, installCodex, isClaudeCodeInstalled, isCodexInstalled, selectInstallMethod, setInstallMethod, uninstallCodeTool, verifyInstallation };
|
|
752
|
+
export { createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, executeInstallMethod, getInstallationStatus, handleInstallFailure, installClaudeCode, installCodex, installMyclaude, isClaudeCodeInstalled, isCodexInstalled, isMyclaudeInstalled, selectInstallMethod, setInstallMethod, uninstallCodeTool, verifyInstallation };
|
package/dist/chunks/mcp-cli.mjs
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
|
-
import { g as getMcpServices } from '
|
|
2
|
+
import { g as getMcpServices } from '../shared/ccjk.DKXs7Fbm.mjs';
|
|
3
3
|
import { i18n } from './index2.mjs';
|
|
4
4
|
import { r as readMcpConfig } from './claude-config.mjs';
|
|
5
|
-
import { i as installMcpService, u as uninstallMcpService } from '../shared/ccjk.
|
|
5
|
+
import { i as installMcpService, u as uninstallMcpService } from '../shared/ccjk.DHaUdzX3.mjs';
|
|
6
6
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
7
|
+
import 'node:child_process';
|
|
7
8
|
import 'node:process';
|
|
8
9
|
import 'node:fs';
|
|
9
10
|
import 'node:url';
|
|
11
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
12
|
+
import './constants.mjs';
|
|
13
|
+
import 'node:os';
|
|
14
|
+
import './json-config.mjs';
|
|
10
15
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
11
|
-
import './
|
|
16
|
+
import './fs-operations.mjs';
|
|
17
|
+
import 'node:crypto';
|
|
18
|
+
import 'node:fs/promises';
|
|
19
|
+
import './platform.mjs';
|
|
20
|
+
import './main.mjs';
|
|
21
|
+
import 'module';
|
|
22
|
+
import 'node:path';
|
|
23
|
+
import 'node:stream';
|
|
12
24
|
import 'node:readline';
|
|
25
|
+
import './index6.mjs';
|
|
13
26
|
import 'stream';
|
|
14
27
|
import 'node:tty';
|
|
15
28
|
import 'node:async_hooks';
|
|
@@ -18,29 +31,17 @@ import 'node:util';
|
|
|
18
31
|
import 'tty';
|
|
19
32
|
import 'fs';
|
|
20
33
|
import 'child_process';
|
|
21
|
-
import 'node:path';
|
|
22
|
-
import 'node:os';
|
|
23
|
-
import 'node:crypto';
|
|
24
34
|
import 'buffer';
|
|
25
35
|
import 'string_decoder';
|
|
36
|
+
import './codex.mjs';
|
|
26
37
|
import './index8.mjs';
|
|
27
38
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
28
39
|
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
29
40
|
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
30
|
-
import './main.mjs';
|
|
31
|
-
import 'module';
|
|
32
|
-
import 'node:child_process';
|
|
33
|
-
import 'node:stream';
|
|
34
|
-
import './constants.mjs';
|
|
35
|
-
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
36
41
|
import './ccjk-config.mjs';
|
|
37
42
|
import './index3.mjs';
|
|
38
|
-
import './fs-operations.mjs';
|
|
39
|
-
import 'node:fs/promises';
|
|
40
|
-
import './json-config.mjs';
|
|
41
43
|
import './config.mjs';
|
|
42
44
|
import '../shared/ccjk.DScm_NnL.mjs';
|
|
43
|
-
import './platform.mjs';
|
|
44
45
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
45
46
|
import './prompts.mjs';
|
|
46
47
|
import '../shared/ccjk.gDEDGD_t.mjs';
|
package/dist/chunks/mcp.mjs
CHANGED
|
@@ -5,10 +5,11 @@ import { readZcfConfig } from './ccjk-config.mjs';
|
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:process';
|
|
7
7
|
import { M as MCP_SERVICE_TIERS, i as isCoreService, g as getServicesByTier, c as checkMcpPerformance, f as formatPerformanceWarning, a as calculateResourceUsage, b as getOptimizationSuggestions, d as getMcpTierConfig } from './mcp-performance.mjs';
|
|
8
|
-
import { r as readMcpConfig,
|
|
9
|
-
export { m as mcpInstall, a as mcpList, b as mcpSearch, c as mcpUninstall } from '../shared/ccjk.
|
|
10
|
-
import { M as MCP_SERVICE_CONFIGS
|
|
11
|
-
import {
|
|
8
|
+
import { r as readMcpConfig, b as backupMcpConfig, w as writeMcpConfig } from './claude-config.mjs';
|
|
9
|
+
export { m as mcpInstall, a as mcpList, b as mcpSearch, c as mcpUninstall } from '../shared/ccjk.B4aXNclK.mjs';
|
|
10
|
+
import { M as MCP_SERVICE_CONFIGS } from '../shared/ccjk.DKXs7Fbm.mjs';
|
|
11
|
+
import { r as readCodexConfig, e as backupCodexComplete, w as writeCodexConfig, g as applyCodexPlatformCommand } from './codex.mjs';
|
|
12
|
+
import { i as isWindows, m as getSystemRoot } from './platform.mjs';
|
|
12
13
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
13
14
|
import 'node:os';
|
|
14
15
|
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
@@ -34,7 +35,7 @@ import 'child_process';
|
|
|
34
35
|
import 'node:path';
|
|
35
36
|
import 'buffer';
|
|
36
37
|
import 'string_decoder';
|
|
37
|
-
import '../shared/ccjk.
|
|
38
|
+
import '../shared/ccjk.DHaUdzX3.mjs';
|
|
38
39
|
import './index8.mjs';
|
|
39
40
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
40
41
|
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
@@ -575,8 +576,8 @@ function getServiceTier(serviceId, tiers) {
|
|
|
575
576
|
return caseInsensitiveMatch?.[1] || "ondemand";
|
|
576
577
|
}
|
|
577
578
|
async function mcpStatus(options = {}) {
|
|
578
|
-
const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.
|
|
579
|
-
const { readCodexConfig } = await import('./codex.mjs').then(function (n) { return n.
|
|
579
|
+
const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.l; });
|
|
580
|
+
const { readCodexConfig } = await import('./codex.mjs').then(function (n) { return n.q; });
|
|
580
581
|
const { checkMcpPerformance, formatPerformanceWarning } = await import('./mcp-performance.mjs').then(function (n) { return n.e; });
|
|
581
582
|
const { MCP_SERVICE_TIERS } = await import('./mcp-performance.mjs').then(function (n) { return n.m; });
|
|
582
583
|
const lang = options.lang || i18n.language || "en";
|
|
@@ -2940,7 +2940,7 @@ const memoryCheck = {
|
|
|
2940
2940
|
}
|
|
2941
2941
|
const fixes = [];
|
|
2942
2942
|
if (!hasMemoryDir || !hasMemoryContent) {
|
|
2943
|
-
fixes.push("Enable Claude
|
|
2943
|
+
fixes.push("Enable shared Claude-family memory in settings");
|
|
2944
2944
|
result.command = "ccjk menu";
|
|
2945
2945
|
}
|
|
2946
2946
|
if (!hasCcjkRules) {
|
package/dist/chunks/package.mjs
CHANGED