ccjk 13.6.3 → 13.6.5

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.
@@ -5,7 +5,7 @@ import { ensureI18nInitialized, i18n, resolveSupportedLanguage, changeLanguage }
5
5
  import { displayBannerWithInfo } from './banner.mjs';
6
6
  import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
7
7
  import { c as runCodexUpdate, m as runCodexUninstall, n as configureCodexAiMemoryFeature, o as configureCodexDefaultModelFeature, p as configureCodexMcp, q as configureCodexApi, t as configureCodexPresetFeature, u as runCodexWorkflowImportWithLanguageSelection, k as runCodexFullInit } from './codex.mjs';
8
- import { r as resolveCodeType } from '../shared/ccjk.CiKtBUW_.mjs';
8
+ import { S as STARTUP_CODE_TOOL_CHOICES, a as resolveStartupCodeType } from '../shared/ccjk.yYQMbHH3.mjs';
9
9
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
10
10
  import { changeScriptLanguageFeature } from './features.mjs';
11
11
  import { c as checkForUpdates, a as getInstalledPackages, s as searchPackages } from '../shared/ccjk.DbigonEQ.mjs';
@@ -3001,11 +3001,14 @@ async function saveLocalHooks(hooks, lastSyncedAt) {
3001
3001
  }
3002
3002
 
3003
3003
  const ONBOARDING_STATE_FILE = join(CCJK_CONFIG_DIR, "onboarding.json");
3004
- const PRIMARY_ONBOARDING_TOOLS = ["claude-code", "codex"];
3005
3004
  const LANGUAGE_SELECTION_MESSAGES = {
3006
3005
  selectLanguage: "Select CCJK display language / \u9009\u62E9 CCJK \u663E\u793A\u8BED\u8A00"
3007
3006
  };
3008
3007
  const TOOL_LABELS = {
3008
+ "myclaude": {
3009
+ en: "myclaude",
3010
+ zh: "myclaude"
3011
+ },
3009
3012
  "claude-code": {
3010
3013
  en: "Claude Code",
3011
3014
  zh: "Claude Code"
@@ -3019,13 +3022,13 @@ function isSupportedLang(value) {
3019
3022
  return SUPPORTED_LANGS.includes(value);
3020
3023
  }
3021
3024
  function isPrimaryOnboardingTool(value) {
3022
- return PRIMARY_ONBOARDING_TOOLS.includes(value);
3025
+ return STARTUP_CODE_TOOL_CHOICES.includes(value);
3023
3026
  }
3024
3027
  function resolveOnboardingCodeTool(value) {
3025
3028
  if (isPrimaryOnboardingTool(value)) {
3026
3029
  return value;
3027
3030
  }
3028
- return "claude-code";
3031
+ return "myclaude";
3029
3032
  }
3030
3033
  function getToolLabel(tool, lang) {
3031
3034
  return lang === "zh-CN" ? TOOL_LABELS[tool].zh : TOOL_LABELS[tool].en;
@@ -3082,7 +3085,11 @@ async function selectOnboardingCodeTool(lang, options = {}) {
3082
3085
  message: isZh ? "\u9009\u62E9\u4EE3\u7801\u5DE5\u5177" : "Choose your code tool",
3083
3086
  choices: addNumbersToChoices([
3084
3087
  {
3085
- name: `${getToolLabel("claude-code", lang)} - ${isZh ? "\u5B8C\u6574 CCJK \u63A7\u5236\u4E2D\u5FC3\uFF0C\u9ED8\u8BA4\u63A8\u8350" : "Full CCJK control center, default choice"}`,
3088
+ name: `${getToolLabel("myclaude", lang)} - ${isZh ? "Provider-first \u63A7\u5236\u4E2D\u5FC3\uFF08\u9ED8\u8BA4\u63A8\u8350\uFF09" : "Provider-first control center (recommended default)"}`,
3089
+ value: "myclaude"
3090
+ },
3091
+ {
3092
+ name: `${getToolLabel("claude-code", lang)} - ${isZh ? "Claude \u5BB6\u65CF\u7ECF\u5178\u63A7\u5236\u4E2D\u5FC3" : "Classic Claude-family control center"}`,
3086
3093
  value: "claude-code"
3087
3094
  },
3088
3095
  {
@@ -3090,7 +3097,7 @@ async function selectOnboardingCodeTool(lang, options = {}) {
3090
3097
  value: "codex"
3091
3098
  }
3092
3099
  ]),
3093
- default: PRIMARY_ONBOARDING_TOOLS.indexOf(defaultTool)
3100
+ default: STARTUP_CODE_TOOL_CHOICES.indexOf(defaultTool)
3094
3101
  });
3095
3102
  const selectedTool = resolveOnboardingCodeTool(tool);
3096
3103
  updateZcfConfig({
@@ -4061,7 +4068,7 @@ function attachHandlers(items, codeTool) {
4061
4068
  await runCodexFullInit();
4062
4069
  return;
4063
4070
  }
4064
- await init({ skipBanner: true });
4071
+ await init({ skipBanner: true, codeType: codeTool });
4065
4072
  }
4066
4073
  };
4067
4074
  case "workflow-import":
@@ -4150,7 +4157,7 @@ function attachHandlers(items, codeTool) {
4150
4157
  return {
4151
4158
  ...item,
4152
4159
  handler: async () => {
4153
- await configSwitchCommand({ codeType: codeTool === "codex" ? "codex" : "claude-code" });
4160
+ await configSwitchCommand({ codeType: codeTool });
4154
4161
  }
4155
4162
  };
4156
4163
  case "context-config":
@@ -4298,6 +4305,14 @@ function flattenSections(itemsBySection) {
4298
4305
  return itemsBySection.flatMap((section) => section.items);
4299
4306
  }
4300
4307
  function getProgressiveFooterCommands(codeTool) {
4308
+ if (codeTool === "myclaude") {
4309
+ return [
4310
+ {
4311
+ key: "s",
4312
+ label: i18n.t("menu:menuOptions.switchCodeTool")
4313
+ }
4314
+ ];
4315
+ }
4301
4316
  if (codeTool !== "codex") {
4302
4317
  return [];
4303
4318
  }
@@ -4318,9 +4333,9 @@ function getProgressiveFooterCommands(codeTool) {
4318
4333
  ];
4319
4334
  }
4320
4335
  function getMenuShellConfig(codeTool) {
4321
- if (codeTool === "codex") {
4336
+ if (codeTool === "codex" || codeTool === "myclaude") {
4322
4337
  return {
4323
- allowMore: false,
4338
+ allowMore: codeTool !== "myclaude",
4324
4339
  footerCommands: getProgressiveFooterCommands(codeTool),
4325
4340
  menuTitle: getToolModeMenuTitle(codeTool),
4326
4341
  showHero: true
@@ -4334,7 +4349,7 @@ function getMenuShellConfig(codeTool) {
4334
4349
  };
4335
4350
  }
4336
4351
  async function showProgressiveMenu(codeTool) {
4337
- if (codeTool !== "codex") {
4352
+ if (codeTool !== "codex" && codeTool !== "myclaude") {
4338
4353
  const rawItems2 = getItemsForLevel(menuState.level, "claude-code");
4339
4354
  const items2 = attachHandlers(rawItems2, "claude-code");
4340
4355
  const sections2 = createAllSections(menuState.level, "claude-code");
@@ -4598,7 +4613,7 @@ async function showMoreFeaturesMenu() {
4598
4613
  await (await import('./permissions.mjs')).listPermissions({});
4599
4614
  break;
4600
4615
  case "9":
4601
- await configSwitchCommand({ codeType: "claude-code" });
4616
+ await configSwitchCommand({ codeType: codeTool });
4602
4617
  break;
4603
4618
  case "10":
4604
4619
  await showContextMenu();
@@ -5154,6 +5169,7 @@ async function showOutputStylesMenu() {
5154
5169
  async function handleCodeToolSwitch(current) {
5155
5170
  const CODE_TOOL_LABELS = {
5156
5171
  "claude-code": "Claude Code",
5172
+ "myclaude": "myclaude",
5157
5173
  "codex": "Codex",
5158
5174
  "aider": "Aider",
5159
5175
  "continue": "Continue",
@@ -5198,18 +5214,21 @@ async function showMainMenu(options = {}) {
5198
5214
  if (await isFirstTimeUser()) {
5199
5215
  await runOnboardingWizard({ preferredCodeTool: options.codeType });
5200
5216
  }
5201
- if (options.codeType) {
5202
- try {
5203
- const resolvedType = await resolveCodeType(options.codeType);
5204
- const currentType = getCurrentCodeTool();
5205
- if (resolvedType !== currentType) {
5206
- updateZcfConfig({ codeToolType: resolvedType });
5217
+ try {
5218
+ const previousType = getCurrentCodeTool();
5219
+ const resolvedType = await resolveStartupCodeType({
5220
+ codeTypeParam: options.codeType,
5221
+ interactive: true
5222
+ });
5223
+ if (resolvedType !== previousType || options.codeType) {
5224
+ updateZcfConfig({ codeToolType: resolvedType });
5225
+ if (resolvedType !== previousType) {
5207
5226
  console.log(a.green(`\u2714 Switched to ${resolvedType}`));
5208
5227
  }
5209
- } catch (err) {
5210
- const errorMessage = err instanceof Error ? err.message : String(err);
5211
- console.error(a.yellow(errorMessage));
5212
5228
  }
5229
+ } catch (err) {
5230
+ const errorMessage = err instanceof Error ? err.message : String(err);
5231
+ console.error(a.yellow(errorMessage));
5213
5232
  }
5214
5233
  let exitMenu = false;
5215
5234
  while (!exitMenu) {
@@ -3,7 +3,7 @@ import process__default from 'node:process';
3
3
  import a from './index5.mjs';
4
4
  import { i as inquirer } from './index6.mjs';
5
5
  import { g as getMcpServices, M as MCP_SERVICE_CONFIGS, k as runCodexFullInit } from './codex.mjs';
6
- import { SETTINGS_FILE, API_DEFAULT_URL, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS } from './constants.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';
@@ -12,15 +12,15 @@ import { exec } from 'node:child_process';
12
12
  import { promisify } from 'node:util';
13
13
  import { updateCcr } from './auto-updater.mjs';
14
14
  import { w as wrapCommandWithSudo, k as isWindows, i as isTermux } from './platform.mjs';
15
- import { a as addCompletedOnboarding, s as setPrimaryApiKey, c as backupMcpConfig, b as buildMcpServerConfig, r as readMcpConfig, e as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, g as syncMcpPermissions } from './claude-config.mjs';
16
- import { r as resolveCodeType } from '../shared/ccjk.CiKtBUW_.mjs';
15
+ import { e as setMyclaudeProviderProfiles, a as addCompletedOnboarding, s as setPrimaryApiKey, f as clearMyclaudeProviderProfiles, c as backupMcpConfig, b as buildMcpServerConfig, r as readMcpConfig, g as replaceMcpServers, h as fixWindowsMcpConfig, w as writeMcpConfig, i as syncMcpPermissions } from './claude-config.mjs';
16
+ import { a as resolveStartupCodeType, r as resolveCodeType } from '../shared/ccjk.yYQMbHH3.mjs';
17
17
  import { exists } from './fs-operations.mjs';
18
18
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
19
19
  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
20
  import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration } from '../shared/ccjk.DDq2hqA5.mjs';
21
21
  import { m as modifyApiConfigPartially, c as configureApiCompletely, a as configureOutputStyle, f as formatApiKeyDisplay } from '../shared/ccjk.BP5hsTZQ.mjs';
22
22
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
23
- import { getInstallationStatus, installClaudeCode } from './installer.mjs';
23
+ import { getInstallationStatus, installMyclaude, installClaudeCode } from './installer.mjs';
24
24
  import { p as parseOrchestrationLevel, w as writeOrchestrationPolicy } from './smart-defaults.mjs';
25
25
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
26
26
  import { resolveAiOutputLanguage } from './prompts.mjs';
@@ -740,6 +740,8 @@ async function handleMultiConfigurations(options, codeToolType) {
740
740
  await validateApiConfigs(configs);
741
741
  if (codeToolType === "claude-code") {
742
742
  await handleClaudeCodeConfigs(configs);
743
+ } else if (codeToolType === "myclaude") {
744
+ await handleMyclaudeConfigs(configs);
743
745
  } else if (codeToolType === "codex") {
744
746
  await handleCodexConfigs(configs);
745
747
  }
@@ -824,6 +826,13 @@ async function handleClaudeCodeConfigs(configs) {
824
826
  }
825
827
  await ClaudeCodeConfigManager.syncCcrProfile();
826
828
  }
829
+ async function handleMyclaudeConfigs(configs) {
830
+ const profiles = await Promise.all(configs.map((config) => convertToMyclaudeProviderProfile(config)));
831
+ const activeProfile = profiles.find((_, index) => configs[index]?.default) || profiles[0];
832
+ setMyclaudeProviderProfiles(profiles, activeProfile?.id);
833
+ const summary = profiles.map((profile) => `${profile.name} [${profile.provider}]`).join(", ");
834
+ console.log(a.gray(` \u2022 ~/.claude.json: ${summary}`));
835
+ }
827
836
  async function handleCodexConfigs(configs) {
828
837
  const { addProviderToExisting } = await import('./codex-provider-manager.mjs');
829
838
  const addedProviderIds = [];
@@ -956,6 +965,18 @@ async function convertToClaudeCodeProfile(config) {
956
965
  defaultOpusModel: config.defaultOpusModel
957
966
  });
958
967
  }
968
+ async function convertToMyclaudeProviderProfile(config) {
969
+ const claudeProfile = await convertToClaudeCodeProfile(config);
970
+ return {
971
+ id: claudeProfile.id || claudeProfile.name,
972
+ name: claudeProfile.name,
973
+ provider: config.provider || "custom",
974
+ apiKey: claudeProfile.apiKey,
975
+ baseUrl: claudeProfile.baseUrl,
976
+ model: claudeProfile.primaryModel,
977
+ fastModel: claudeProfile.defaultHaikuModel
978
+ };
979
+ }
959
980
  async function convertToCodexProvider(config) {
960
981
  const displayName = config.name || config.provider || "custom";
961
982
  const providerId = displayName.toLowerCase().replace(/[^a-z0-9]/g, "-");
@@ -1022,11 +1043,14 @@ async function init(options = {}) {
1022
1043
  tracker.nextStep();
1023
1044
  let codeToolType;
1024
1045
  try {
1025
- codeToolType = await resolveCodeType(options.codeType);
1046
+ codeToolType = await resolveStartupCodeType({
1047
+ codeTypeParam: options.codeType,
1048
+ interactive: !options.skipPrompt
1049
+ });
1026
1050
  } catch (error) {
1027
1051
  const errorMessage = error instanceof Error ? error.message : String(error);
1028
1052
  console.error(a.red(`${i18n.t("errors:generalError")} ${errorMessage}`));
1029
- codeToolType = DEFAULT_CODE_TOOL_TYPE;
1053
+ codeToolType = await resolveCodeType(options.codeType).catch(() => DEFAULT_CODE_TOOL_TYPE);
1030
1054
  }
1031
1055
  options.codeType = codeToolType;
1032
1056
  async function selectApiConfigurationMode() {
@@ -1056,7 +1080,7 @@ async function init(options = {}) {
1056
1080
  return apiMode;
1057
1081
  }
1058
1082
  async function handleCustomApiConfiguration(existingConfig) {
1059
- if (codeToolType === "claude-code") {
1083
+ if (codeToolType === "claude-code" || codeToolType === "myclaude") {
1060
1084
  const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
1061
1085
  await configureIncrementalManagement();
1062
1086
  return null;
@@ -1186,36 +1210,48 @@ async function init(options = {}) {
1186
1210
  zcfConfig,
1187
1211
  options.skipPrompt
1188
1212
  );
1189
- const installationStatus = await getInstallationStatus();
1190
- if (installationStatus.hasGlobal) {
1191
- const { verifyInstallation, displayVerificationResult } = await import('./installer.mjs');
1192
- const verification = await verifyInstallation("claude-code");
1193
- if (verification.symlinkCreated) {
1194
- console.log(a.green(`\u2714 ${i18n.t("installation:alreadyInstalled")}`));
1195
- displayVerificationResult(verification, "claude-code");
1196
- } else if (!verification.success) {
1197
- console.log(a.yellow(`\u26A0 ${i18n.t("installation:verificationFailed")}`));
1198
- if (verification.error) {
1199
- console.log(a.gray(` ${verification.error}`));
1213
+ const installerCodeType = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
1214
+ const installationStatus = await getInstallationStatus(installerCodeType);
1215
+ const codeToolName = CODE_TOOL_INFO[codeToolType].name;
1216
+ if (isClaudeFamilyCodeTool(codeToolType)) {
1217
+ if (installationStatus.hasGlobal) {
1218
+ const { verifyInstallation, displayVerificationResult } = await import('./installer.mjs');
1219
+ const verification = await verifyInstallation(installerCodeType);
1220
+ if (verification.symlinkCreated) {
1221
+ console.log(a.green(`\u2714 ${codeToolName} ${i18n.t("installation:alreadyInstalled")}`));
1222
+ displayVerificationResult(verification, installerCodeType);
1223
+ } else if (!verification.success) {
1224
+ console.log(a.yellow(`\u26A0 ${i18n.t("installation:verificationFailed")}`));
1225
+ if (verification.error) {
1226
+ console.log(a.gray(` ${verification.error}`));
1227
+ }
1200
1228
  }
1201
- }
1202
- } else {
1203
- if (options.skipPrompt) {
1204
- await installClaudeCode(true);
1205
1229
  } else {
1206
- const shouldInstall = await promptBoolean({
1207
- message: i18n.t("installation:installPrompt"),
1208
- defaultValue: true
1209
- });
1210
- if (shouldInstall) {
1211
- await installClaudeCode(false);
1230
+ if (options.skipPrompt) {
1231
+ if (codeToolType === "myclaude") {
1232
+ await installMyclaude(true);
1233
+ } else {
1234
+ await installClaudeCode(true);
1235
+ }
1212
1236
  } else {
1213
- console.log(a.yellow(i18n.t("common:skip")));
1237
+ const shouldInstall = await promptBoolean({
1238
+ message: i18n.t("installation:installPrompt"),
1239
+ defaultValue: true
1240
+ });
1241
+ if (shouldInstall) {
1242
+ if (codeToolType === "myclaude") {
1243
+ await installMyclaude(false);
1244
+ } else {
1245
+ await installClaudeCode(false);
1246
+ }
1247
+ } else {
1248
+ console.log(a.yellow(i18n.t("common:skip")));
1249
+ }
1214
1250
  }
1215
1251
  }
1216
- }
1217
- if (installationStatus.hasGlobal) {
1218
- await checkClaudeCodeVersionAndPrompt(options.skipPrompt);
1252
+ if (installationStatus.hasGlobal && codeToolType === "claude-code") {
1253
+ await checkClaudeCodeVersionAndPrompt(options.skipPrompt);
1254
+ }
1219
1255
  }
1220
1256
  ensureClaudeDir();
1221
1257
  if (existsSync(SETTINGS_FILE) && needsMigration()) {
@@ -1317,6 +1353,9 @@ async function init(options = {}) {
1317
1353
  if (options.apiConfigs || options.apiConfigsFile) {
1318
1354
  await handleMultiConfigurations(options, codeToolType);
1319
1355
  apiConfig = null;
1356
+ if (codeToolType === "claude-code") {
1357
+ clearMyclaudeProviderProfiles();
1358
+ }
1320
1359
  } else if (options.provider && options.apiKey) {
1321
1360
  const { getProviderPreset } = await import('./api-providers.mjs');
1322
1361
  const preset = options.provider !== "custom" ? getProviderPreset(options.provider) : null;
@@ -1445,10 +1484,46 @@ async function init(options = {}) {
1445
1484
  console.log(a.green(`\u2714 ${i18n.t("api:apiConfigSuccess")}`));
1446
1485
  console.log(a.gray(` URL: ${configuredApi.url}`));
1447
1486
  console.log(a.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
1487
+ if (codeToolType === "myclaude") {
1488
+ try {
1489
+ if (!configuredApi.authType) {
1490
+ throw new Error("Configured API is missing authType");
1491
+ }
1492
+ const profile = await convertSingleConfigToProfile(
1493
+ {
1494
+ authType: configuredApi.authType,
1495
+ key: configuredApi.key,
1496
+ url: configuredApi.url
1497
+ },
1498
+ options.provider,
1499
+ {
1500
+ apiModel: options.apiModel,
1501
+ apiHaikuModel: options.apiHaikuModel,
1502
+ apiSonnetModel: options.apiSonnetModel,
1503
+ apiOpusModel: options.apiOpusModel
1504
+ }
1505
+ );
1506
+ setMyclaudeProviderProfiles([
1507
+ {
1508
+ id: profile.id || profile.name,
1509
+ name: profile.name,
1510
+ provider: options.provider || "custom",
1511
+ apiKey: profile.apiKey,
1512
+ baseUrl: profile.baseUrl,
1513
+ model: profile.primaryModel,
1514
+ fastModel: profile.defaultHaikuModel
1515
+ }
1516
+ ], profile.id || profile.name);
1517
+ } catch (error) {
1518
+ console.log(a.yellow(`\u26A0 Failed to write myclaude provider profile: ${error}`));
1519
+ }
1520
+ } else if (codeToolType === "claude-code") {
1521
+ clearMyclaudeProviderProfiles();
1522
+ }
1448
1523
  }
1449
1524
  }
1450
1525
  const hasModelParams = options.apiModel || options.apiHaikuModel || options.apiSonnetModel || options.apiOpusModel;
1451
- if (hasModelParams && action !== "docs-only" && codeToolType === "claude-code") {
1526
+ if (hasModelParams && action !== "docs-only" && (codeToolType === "claude-code" || codeToolType === "myclaude")) {
1452
1527
  if (options.skipPrompt) {
1453
1528
  const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.j; });
1454
1529
  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, i as isTermux, b as getTermuxPrefix, c as isWSL, d as getWSLInfo, w as wrapCommandWithSudo, e as commandExists, h as getRecommendedInstallMethods } from './platform.mjs';
12
+ import { f as findCommandPath, g as getPlatform, a as getHomebrewCommandPaths, i as isTermux, b as getTermuxPrefix, w as wrapCommandWithSudo, c as isWSL, d as getWSLInfo, e as commandExists, h 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 === "claude-code") {
185
- const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.h; });
226
+ if (isClaudeFamilyCodeTool(codeType)) {
227
+ const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.j; });
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 === "claude-code" ? i18n.t("common:claudeCode") : i18n.t("common:codex");
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 === "claude-code" ? "claude" : "codex";
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 === "claude-code") {
299
- const { readMcpConfig, writeMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.h; });
350
+ if (isClaudeFamilyCodeTool(codeType)) {
351
+ const { readMcpConfig, writeMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.j; });
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 === "claude-code" ? "claude" : "codex";
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 === "claude-code" ? i18n.t("common:claudeCode") : i18n.t("common:codex");
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 === "claude-code" ? i18n.t("common:claudeCode") : i18n.t("common:codex");
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 === "claude-code" ? "claude" : "codex";
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 === "claude-code" ? i18n.t("common:claudeCode") : i18n.t("common:codex");
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 };
@@ -575,7 +575,7 @@ function getServiceTier(serviceId, tiers) {
575
575
  return caseInsensitiveMatch?.[1] || "ondemand";
576
576
  }
577
577
  async function mcpStatus(options = {}) {
578
- const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.h; });
578
+ const { readMcpConfig } = await import('./claude-config.mjs').then(function (n) { return n.j; });
579
579
  const { readCodexConfig } = await import('./codex.mjs').then(function (n) { return n.v; });
580
580
  const { checkMcpPerformance, formatPerformanceWarning } = await import('./mcp-performance.mjs').then(function (n) { return n.e; });
581
581
  const { MCP_SERVICE_TIERS } = await import('./mcp-performance.mjs').then(function (n) { return n.m; });
@@ -1,3 +1,3 @@
1
- const version = "13.6.3";
1
+ const version = "13.6.5";
2
2
 
3
3
  export { version };
@@ -230,6 +230,7 @@ async function getHomebrewCommandPaths(command) {
230
230
  }
231
231
  const caskNameMap = {
232
232
  claude: "claude-code",
233
+ myclaude: "myclaude-code",
233
234
  codex: "codex"
234
235
  };
235
236
  const caskName = caskNameMap[command];
@@ -356,6 +357,9 @@ function getRecommendedInstallMethods(codeType) {
356
357
  return ["powershell", "npm"];
357
358
  }
358
359
  }
360
+ if (codeType === "myclaude") {
361
+ return ["npm"];
362
+ }
359
363
  if (codeType === "codex") {
360
364
  if (platform2 === "macos") {
361
365
  return ["homebrew", "npm"];