ccjk 13.6.4 → 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 { c as contextLoader, S as SessionIntelligence, g as getGlobalConvoyManag
5
5
  import { EventEmitter } from 'node:events';
6
6
  import { c as resolve } from '../shared/ccjk.bQ7Dh1g4.mjs';
7
7
  import { e as executionTracer } from '../shared/ccjk.DlTXS9rP.mjs';
8
- import { t as taskPersistence } from '../shared/ccjk.DwSebGy0.mjs';
8
+ import { t as taskPersistence } from '../shared/ccjk.BOO14f66.mjs';
9
9
  import '../shared/ccjk.BAGoDD49.mjs';
10
10
  import 'node:crypto';
11
11
  import 'node:process';
@@ -47,7 +47,7 @@ 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.CiKtBUW_.mjs';
50
+ import '../shared/ccjk.yYQMbHH3.mjs';
51
51
  import './smart-defaults.mjs';
52
52
  import '../shared/ccjk.DJuyfrlL.mjs';
53
53
  import './features.mjs';
@@ -1,46 +1,46 @@
1
1
  import process__default from 'node:process';
2
2
  import a from './index5.mjs';
3
3
  import { ensureI18nInitialized, i18n } from './index2.mjs';
4
- import { r as resolveCodeType } from '../shared/ccjk.CiKtBUW_.mjs';
4
+ import { r as resolveCodeType } from '../shared/ccjk.yYQMbHH3.mjs';
5
5
  import { checkAndUpdateTools } 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';
9
9
  import 'node:url';
10
10
  import '../shared/ccjk.bQ7Dh1g4.mjs';
11
+ import './index6.mjs';
12
+ import 'node:readline';
13
+ import 'stream';
14
+ import 'node:tty';
15
+ import 'node:async_hooks';
16
+ import '../shared/ccjk.Cjgrln_h.mjs';
17
+ import 'node:util';
18
+ import 'tty';
19
+ import 'fs';
20
+ import 'child_process';
21
+ import 'node:path';
22
+ import 'node:os';
23
+ import 'node:crypto';
24
+ import 'buffer';
25
+ import 'string_decoder';
11
26
  import './smart-defaults.mjs';
12
27
  import 'node:child_process';
13
- import 'node:os';
14
28
  import './constants.mjs';
15
29
  import './json-config.mjs';
16
30
  import '../shared/ccjk.RyizuzOI.mjs';
17
31
  import './fs-operations.mjs';
18
- import 'node:crypto';
19
32
  import 'node:fs/promises';
20
33
  import './platform.mjs';
21
34
  import './main.mjs';
22
35
  import 'module';
23
- import 'node:path';
24
36
  import 'node:stream';
25
- import 'node:readline';
26
37
  import '../shared/ccjk.DJuyfrlL.mjs';
27
38
  import './ccjk-config.mjs';
28
39
  import '../shared/ccjk.BBtCGd_g.mjs';
29
40
  import './index3.mjs';
30
41
  import './index8.mjs';
31
- import '../shared/ccjk.Cjgrln_h.mjs';
32
42
  import '../shared/ccjk.DeWpAShp.mjs';
33
43
  import '../shared/ccjk.DZ2LLOa-.mjs';
34
- import 'node:async_hooks';
35
- import './index6.mjs';
36
- import 'stream';
37
- import 'node:tty';
38
- import 'node:util';
39
- import 'tty';
40
- import 'fs';
41
- import 'child_process';
42
- import 'buffer';
43
- import 'string_decoder';
44
44
  import './version-checker.mjs';
45
45
  import '../shared/ccjk.CxpGa6MC.mjs';
46
46
  import './config.mjs';
@@ -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.h; });
278
+ const { setPrimaryApiKey, addCompletedOnboarding } = await import('./claude-config.mjs').then(function (n) { return n.j; });
279
279
  setPrimaryApiKey();
280
280
  addCompletedOnboarding();
281
281
  let verifiedSettings = readJsonConfig2(SETTINGS_FILE) || {};
@@ -197,6 +197,21 @@ function setPrimaryApiKey() {
197
197
  console.error(i18n.t("mcp:primaryApiKeySetFailed"), error);
198
198
  }
199
199
  }
200
+ function setMyclaudeProviderProfiles(profiles, activeProfileId) {
201
+ const config = readMcpConfig() || { mcpServers: {} };
202
+ config.myclaudeProviderProfiles = profiles;
203
+ config.myclaudeActiveProviderProfileId = activeProfileId || profiles[0]?.id;
204
+ writeMcpConfig(config);
205
+ }
206
+ function clearMyclaudeProviderProfiles() {
207
+ const config = readMcpConfig();
208
+ if (!config) {
209
+ return;
210
+ }
211
+ delete config.myclaudeProviderProfiles;
212
+ delete config.myclaudeActiveProviderProfileId;
213
+ writeMcpConfig(config);
214
+ }
200
215
  function syncMcpPermissions() {
201
216
  const mcpConfig = readMcpConfig();
202
217
  const mcpServerIds = Object.keys(mcpConfig?.mcpServers || {});
@@ -222,15 +237,17 @@ const claudeConfig = {
222
237
  addCompletedOnboarding: addCompletedOnboarding,
223
238
  backupMcpConfig: backupMcpConfig,
224
239
  buildMcpServerConfig: buildMcpServerConfig,
240
+ clearMyclaudeProviderProfiles: clearMyclaudeProviderProfiles,
225
241
  ensureApiKeyApproved: ensureApiKeyApproved,
226
242
  fixWindowsMcpConfig: fixWindowsMcpConfig,
227
243
  manageApiKeyApproval: manageApiKeyApproval,
228
244
  mergeMcpServers: mergeMcpServers,
229
245
  readMcpConfig: readMcpConfig,
230
246
  replaceMcpServers: replaceMcpServers,
247
+ setMyclaudeProviderProfiles: setMyclaudeProviderProfiles,
231
248
  setPrimaryApiKey: setPrimaryApiKey,
232
249
  syncMcpPermissions: syncMcpPermissions,
233
250
  writeMcpConfig: writeMcpConfig
234
251
  };
235
252
 
236
- export { addCompletedOnboarding as a, buildMcpServerConfig as b, backupMcpConfig as c, deepMerge as d, replaceMcpServers as e, fixWindowsMcpConfig as f, syncMcpPermissions as g, claudeConfig as h, mergeMcpServers as m, readMcpConfig as r, setPrimaryApiKey as s, writeMcpConfig as w };
253
+ export { addCompletedOnboarding as a, buildMcpServerConfig as b, backupMcpConfig as c, deepMerge as d, setMyclaudeProviderProfiles as e, clearMyclaudeProviderProfiles as f, replaceMcpServers as g, fixWindowsMcpConfig as h, syncMcpPermissions as i, claudeConfig as j, mergeMcpServers as m, readMcpConfig as r, setPrimaryApiKey as s, writeMcpConfig as w };
@@ -1,4 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
+ import { DEFAULT_CODE_TOOL_TYPE, isCodeToolType, getCodeToolNativeSlashCommands } from './constants.mjs';
3
+ import { readZcfConfig } from './ccjk-config.mjs';
2
4
  import { a as getGlobalStateManager, g as getGlobalConvoyManager, c as contextLoader, S as SessionIntelligence } from './session-manager.mjs';
3
5
  import { l as logger } from '../shared/ccjk.8oaxX4iR.mjs';
4
6
  import { h as hookRegistry } from '../shared/ccjk.KPLeMP-o.mjs';
@@ -9,6 +11,15 @@ import { d as dirname, j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
9
11
  import { n as nanoid } from '../shared/ccjk.BoApaI4j.mjs';
10
12
  import process__default from 'node:process';
11
13
  import 'node:os';
14
+ import './index2.mjs';
15
+ import 'node:url';
16
+ import '../shared/ccjk.BBtCGd_g.mjs';
17
+ import './index3.mjs';
18
+ import './fs-operations.mjs';
19
+ import 'node:fs/promises';
20
+ import './json-config.mjs';
21
+ import '../shared/ccjk.RyizuzOI.mjs';
22
+ import '../shared/ccjk.BAGoDD49.mjs';
12
23
  import './main.mjs';
13
24
  import 'module';
14
25
  import 'node:child_process';
@@ -18,9 +29,7 @@ import 'node:readline';
18
29
  import 'tinyglobby';
19
30
  import '../shared/ccjk.DlTXS9rP.mjs';
20
31
  import './index5.mjs';
21
- import '../shared/ccjk.BAGoDD49.mjs';
22
32
  import '../shared/ccjk.wLJHO0Af.mjs';
23
- import 'node:fs/promises';
24
33
 
25
34
  async function emitCommandHookEvent(event, data, sessionId) {
26
35
  try {
@@ -3540,80 +3549,13 @@ class CliInterceptor extends EventEmitter {
3540
3549
  autoSelectMcp: true,
3541
3550
  verbose: false
3542
3551
  });
3543
- // Claude Code native commands that should bypass interception
3544
- // Reference: https://deepwiki.com/FlorianBruniaux/claude-code-ultimate-guide/16-command-reference
3545
- systemCommands = [
3546
- // Session Management
3547
- "/help",
3548
- "/clear",
3549
- "/exit",
3550
- "/quit",
3551
- "/resume",
3552
- // Context Management
3553
- "/compact",
3554
- "/context",
3555
- "/status",
3556
- // Mode Control
3557
- "/plan",
3558
- "/execute",
3559
- // History
3560
- "/rewind",
3561
- // Diagnostic
3562
- "/mcp",
3563
- "/doctor",
3564
- // Configuration
3565
- "/settings",
3566
- "/config",
3567
- "/version",
3568
- // Extension System
3569
- "/agents",
3570
- "/skills",
3571
- "/commands",
3572
- // Plugin/Marketplace - CCJK 接管,不在此列表
3573
- // '/plugin',
3574
- // '/plugins',
3575
- // Tasks
3576
- "/tasks",
3577
- // Memory
3578
- "/memory",
3579
- "/memories",
3580
- // Model
3581
- "/model",
3582
- // Cost
3583
- "/cost",
3584
- // Permissions
3585
- "/permissions",
3586
- // Hooks
3587
- "/hooks",
3588
- // Init
3589
- "/init",
3590
- // Login/Logout
3591
- "/login",
3592
- "/logout",
3593
- // Bug report
3594
- "/bug",
3595
- // Terminal
3596
- "/terminal",
3597
- // IDE
3598
- "/ide",
3599
- // Review
3600
- "/review",
3601
- // PR
3602
- "/pr",
3603
- // Vim mode
3604
- "/vim",
3605
- // Listen mode
3606
- "/listen",
3607
- // Add files
3608
- "/add",
3609
- // Install
3610
- "/install",
3611
- // Allowed tools
3612
- "/allowed-tools",
3613
- // Thinking
3614
- "/think",
3615
- "/thinking"
3616
- ];
3552
+ getActiveCodeTool() {
3553
+ const codeToolType = readZcfConfig()?.codeToolType;
3554
+ return isCodeToolType(codeToolType) ? codeToolType : DEFAULT_CODE_TOOL_TYPE;
3555
+ }
3556
+ getSystemCommands() {
3557
+ return getCodeToolNativeSlashCommands(this.getActiveCodeTool());
3558
+ }
3617
3559
  // Simple queries that don't need interception
3618
3560
  simpleQueryPatterns = [
3619
3561
  /^what is/i,
@@ -3679,13 +3621,14 @@ class CliInterceptor extends EventEmitter {
3679
3621
  */
3680
3622
  shouldBypass(input) {
3681
3623
  const normalized = input.trim().toLowerCase();
3624
+ const systemCommands = this.getSystemCommands();
3682
3625
  if (normalized.startsWith("/")) {
3683
3626
  const isCcjkOwned = this.config.ccjkOwnedSlashPrefixes.some((prefix) => normalized.startsWith(prefix));
3684
- if (!isCcjkOwned) {
3627
+ if (!isCcjkOwned && systemCommands.some((cmd) => normalized.startsWith(cmd))) {
3685
3628
  return { bypass: true, reason: "Native slash command passthrough" };
3686
3629
  }
3687
3630
  }
3688
- if (this.systemCommands.some((cmd) => normalized.startsWith(cmd))) {
3631
+ if (systemCommands.some((cmd) => normalized.startsWith(cmd))) {
3689
3632
  return { bypass: true, reason: "System command" };
3690
3633
  }
3691
3634
  if (this.config.bypassKeywords.some((kw) => normalized.includes(kw.toLowerCase()))) {
@@ -415,7 +415,7 @@ async function setupCcrConfiguration() {
415
415
  console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
416
416
  await configureCcrProxy(existingConfig);
417
417
  try {
418
- const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
418
+ const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.j; });
419
419
  const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
420
420
  manageApiKeyApproval(apiKey);
421
421
  console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
@@ -449,7 +449,7 @@ async function setupCcrConfiguration() {
449
449
  console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
450
450
  }
451
451
  try {
452
- const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.h; });
452
+ const { manageApiKeyApproval } = await import('./claude-config.mjs').then(function (n) { return n.j; });
453
453
  const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
454
454
  manageApiKeyApproval(apiKey);
455
455
  console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
@@ -79,10 +79,12 @@ const LEGACY_ZCF_CONFIG_FILES = [
79
79
  ];
80
80
  const ZCF_CONFIG_DIR = CCJK_CONFIG_DIR;
81
81
  const ZCF_CONFIG_FILE = CCJK_CONFIG_FILE;
82
- const CODE_TOOL_TYPES = ["claude-code", "codex", "aider", "continue", "cline", "cursor"];
82
+ const CODE_TOOL_TYPES = ["claude-code", "myclaude", "codex", "aider", "continue", "cline", "cursor"];
83
83
  const DEFAULT_CODE_TOOL_TYPE = "claude-code";
84
+ const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "myclaude"];
84
85
  const CODE_TOOL_BANNERS = {
85
86
  "claude-code": "for Claude Code",
87
+ "myclaude": "for myclaude",
86
88
  "codex": "for Codex",
87
89
  "aider": "for Aider",
88
90
  "continue": "for Continue",
@@ -91,15 +93,189 @@ const CODE_TOOL_BANNERS = {
91
93
  };
92
94
  const CODE_TOOL_ALIASES = {
93
95
  cc: "claude-code",
96
+ mc: "myclaude",
97
+ mycode: "myclaude",
94
98
  cx: "codex",
95
99
  ad: "aider",
96
100
  ct: "continue",
97
101
  cl: "cline",
98
102
  cu: "cursor"
99
103
  };
104
+ const CODE_TOOL_INFO = {
105
+ "claude-code": {
106
+ name: "Claude Code",
107
+ description: "Anthropic official CLI for Claude",
108
+ website: "https://claude.ai/code",
109
+ installCmd: "npm install -g @anthropic-ai/claude-code",
110
+ configFormat: "json",
111
+ category: "cli",
112
+ runtimeCommand: "claude",
113
+ configBackend: "claude-family",
114
+ nativeSlashCommands: [
115
+ "/help",
116
+ "/clear",
117
+ "/exit",
118
+ "/quit",
119
+ "/resume",
120
+ "/compact",
121
+ "/context",
122
+ "/status",
123
+ "/plan",
124
+ "/execute",
125
+ "/rewind",
126
+ "/mcp",
127
+ "/doctor",
128
+ "/settings",
129
+ "/config",
130
+ "/version",
131
+ "/agents",
132
+ "/skills",
133
+ "/commands",
134
+ "/tasks",
135
+ "/memory",
136
+ "/memories",
137
+ "/model",
138
+ "/cost",
139
+ "/permissions",
140
+ "/hooks",
141
+ "/init",
142
+ "/login",
143
+ "/logout",
144
+ "/bug",
145
+ "/terminal",
146
+ "/ide",
147
+ "/review",
148
+ "/pr",
149
+ "/vim",
150
+ "/listen",
151
+ "/add",
152
+ "/install",
153
+ "/allowed-tools",
154
+ "/think",
155
+ "/thinking"
156
+ ],
157
+ managesProviderProfiles: false
158
+ },
159
+ "myclaude": {
160
+ name: "myclaude",
161
+ description: "Provider-first Claude-family coding CLI",
162
+ website: "https://github.com/mycode699/myclaude-code",
163
+ installCmd: "npm install -g myclaude-code && myclaude install --force",
164
+ configFormat: "json",
165
+ category: "cli",
166
+ runtimeCommand: "myclaude",
167
+ configBackend: "claude-family",
168
+ nativeSlashCommands: [
169
+ "/help",
170
+ "/clear",
171
+ "/exit",
172
+ "/quit",
173
+ "/resume",
174
+ "/compact",
175
+ "/context",
176
+ "/status",
177
+ "/plan",
178
+ "/execute",
179
+ "/rewind",
180
+ "/mcp",
181
+ "/doctor",
182
+ "/settings",
183
+ "/config",
184
+ "/version",
185
+ "/agents",
186
+ "/skills",
187
+ "/commands",
188
+ "/tasks",
189
+ "/memory",
190
+ "/memories",
191
+ "/model",
192
+ "/cost",
193
+ "/permissions",
194
+ "/hooks",
195
+ "/init",
196
+ "/login",
197
+ "/logout",
198
+ "/bug",
199
+ "/terminal",
200
+ "/ide",
201
+ "/review",
202
+ "/pr",
203
+ "/vim",
204
+ "/listen",
205
+ "/add",
206
+ "/install",
207
+ "/allowed-tools",
208
+ "/think",
209
+ "/thinking",
210
+ "/provider",
211
+ "/team",
212
+ "/mao"
213
+ ],
214
+ managesProviderProfiles: true
215
+ },
216
+ "codex": {
217
+ name: "Codex",
218
+ description: "OpenAI Codex CLI",
219
+ website: "https://openai.com/codex",
220
+ installCmd: "npm install -g @openai/codex",
221
+ configFormat: "toml",
222
+ category: "cli",
223
+ runtimeCommand: "codex",
224
+ configBackend: "tool-specific"
225
+ },
226
+ "aider": {
227
+ name: "Aider",
228
+ description: "AI pair programming in terminal",
229
+ website: "https://aider.chat",
230
+ installCmd: "pip install aider-chat",
231
+ configFormat: "yaml",
232
+ category: "cli",
233
+ runtimeCommand: "aider",
234
+ configBackend: "tool-specific"
235
+ },
236
+ "continue": {
237
+ name: "Continue",
238
+ description: "Open-source AI code assistant",
239
+ website: "https://continue.dev",
240
+ installCmd: "pip install continuedev",
241
+ configFormat: "json",
242
+ category: "extension",
243
+ runtimeCommand: "continue",
244
+ configBackend: "tool-specific"
245
+ },
246
+ "cline": {
247
+ name: "Cline",
248
+ description: "Autonomous coding agent for VS Code",
249
+ website: "https://cline.bot",
250
+ installCmd: "code --install-extension saoudrizwan.claude-dev",
251
+ configFormat: "json",
252
+ category: "extension",
253
+ runtimeCommand: "cline",
254
+ configBackend: "tool-specific"
255
+ },
256
+ "cursor": {
257
+ name: "Cursor CLI",
258
+ description: "AI-first code editor CLI",
259
+ website: "https://cursor.com/cli",
260
+ installCmd: "curl https://cursor.com/install -fsSL | bash",
261
+ configFormat: "json",
262
+ category: "editor",
263
+ runtimeCommand: "cursor",
264
+ configBackend: "tool-specific"
265
+ }
266
+ };
100
267
  function isCodeToolType(value) {
101
268
  return CODE_TOOL_TYPES.includes(value);
102
269
  }
270
+ function isClaudeFamilyCodeTool(value) {
271
+ return CLAUDE_FAMILY_CODE_TOOL_TYPES.includes(value);
272
+ }
273
+ function getCodeToolRuntimeCommand(codeTool) {
274
+ return CODE_TOOL_INFO[codeTool].runtimeCommand;
275
+ }
276
+ function getCodeToolNativeSlashCommands(codeTool) {
277
+ return CODE_TOOL_INFO[codeTool].nativeSlashCommands || [];
278
+ }
103
279
  const API_DEFAULT_URL = "https://api.anthropic.com";
104
280
  function resolveCodeToolType(value) {
105
281
  if (isCodeToolType(value)) {
@@ -133,4 +309,4 @@ function getAiOutputLanguageLabel(lang) {
133
309
  return lang;
134
310
  }
135
311
 
136
- export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_VSC_CONFIG_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, isCodeToolType, resolveCodeToolType };
312
+ export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_FAMILY_CODE_TOOL_TYPES, CLAUDE_VSC_CONFIG_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, getCodeToolNativeSlashCommands, getCodeToolRuntimeCommand, isClaudeFamilyCodeTool, isCodeToolType, resolveCodeToolType };
@@ -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) {