ccjk 16.0.0-alpha.3 → 16.0.2

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.
@@ -36,7 +36,12 @@
36
36
  "menuOptions.codexUninstall": "Uninstall Codex",
37
37
  "menuOptions.codexCheckUpdates": "Check Codex updates",
38
38
  "menuSections.otherTools": "Other Tools",
39
- "menuDescriptions.switchCodeTool": "Switch between supported code tools (Claude Code, Codex)",
39
+ "menuDescriptions.switchCodeTool": "Switch between Clavue, Claude Code, Codex, and Grok CLI",
40
+ "menuOptions.grokInit": "Configure API / Profile",
41
+ "menuOptions.grokStatus": "Status & Launch",
42
+ "menuDescriptions.grokInit": "Save a ccjk profile for Grok (API key + model)",
43
+ "menuDescriptions.grokStatus": "Detect Grok CLI install/login and show launch commands",
44
+ "menuDescriptions.grokInitHint": "After setup, run: ccjk grok <profile>",
40
45
  "menuDescriptions.codexFullInit": "Install Codex + Import workflow + Configure API + Configure MCP",
41
46
  "menuDescriptions.codexImportWorkflow": "Import/update Codex workflow-related files",
42
47
  "menuDescriptions.codexConfigureApi": "Configure Codex API providers",
@@ -45,6 +50,26 @@
45
50
  "menuDescriptions.codexConfigureAiMemory": "Configure AI output language and system prompt style",
46
51
  "menuDescriptions.codexUninstall": "Remove Codex configuration and files",
47
52
  "menuDescriptions.codexCheckUpdates": "Check and update Codex",
53
+ "menuOptions.clavueFullInit": "Set up Clavue",
54
+ "menuOptions.clavueUpdateWorkflow": "Update Clavue",
55
+ "menuOptions.clavueConfigureApi": "Configure API",
56
+ "menuOptions.clavueConfigureMcp": "Configure MCP",
57
+ "menuOptions.clavueConfigureModel": "Configure default model",
58
+ "menuOptions.clavueConfigureAiMemory": "Configure AI memory",
59
+ "menuOptions.clavueConfigureEnvPermission": "Environment & permissions",
60
+ "menuOptions.clavueStatus": "Status probe",
61
+ "menuOptions.clavueUninstall": "Uninstall Clavue config",
62
+ "menuOptions.clavueCheckUpdates": "Check Clavue updates",
63
+ "menuDescriptions.clavueFullInit": "Full Clavue setup (workflows + API + MCP + permissions)",
64
+ "menuDescriptions.clavueUpdateWorkflow": "Update Clavue workflows and template files",
65
+ "menuDescriptions.clavueConfigureApi": "Configure Clavue API URL, key, or CCR proxy",
66
+ "menuDescriptions.clavueConfigureMcp": "Configure Clavue MCP services",
67
+ "menuDescriptions.clavueConfigureModel": "Set Clavue default model",
68
+ "menuDescriptions.clavueConfigureAiMemory": "Configure Clavue AI output language and style",
69
+ "menuDescriptions.clavueConfigureEnvPermission": "Import recommended Clavue env vars and permissions",
70
+ "menuDescriptions.clavueStatus": "Probe current Clavue API configuration",
71
+ "menuDescriptions.clavueUninstall": "Remove ~/.clavue configuration and related files",
72
+ "menuDescriptions.clavueCheckUpdates": "Check and update Clavue, CCR, and CCometixLine",
48
73
  "switchCodeToolPrompt": "Select code tool type",
49
74
  "codeToolSwitched": "Code tool switched to {{tool}}",
50
75
  "selectFunction": "Select function"
@@ -14,7 +14,7 @@
14
14
  "failedToSwitchToCcr": "Failed to switch to CCR proxy: {error}",
15
15
  "successfullySwitchedToProfile": "Successfully switched to profile: {{name}}",
16
16
  "failedToSwitchToProfile": "Failed to switch to profile: {{error}}",
17
- "incrementalManagementTitle": "📋 Claude Code Configuration Management",
17
+ "incrementalManagementTitle": "📋 {{runtime}} Configuration Management",
18
18
  "currentProfileCount": "Current profile count: {{count}}",
19
19
  "currentDefaultProfile": "Current default profile: {{profile}}",
20
20
  "addProfile": "Add Profile",
@@ -46,7 +46,7 @@
46
46
  "help.exampleDescriptions.checkClaudeCode": "检查并更新Claude Code工具",
47
47
  "help.exampleDescriptions.checkCodex": "检查并更新Codex工具",
48
48
  "help.exampleDescriptions.nonInteractiveModeCicd": "非交互模式(CI/CD)",
49
- "banner.subtitle": "Claude Code 一键配置工具",
49
+ "banner.subtitle": "四工具统一配置",
50
50
  "banner.updateSubtitle": "更新 Claude Code 配置",
51
51
  "help.defaults.dailyUsage": "每日用量(默认)",
52
52
  "help.defaults.interactiveUninstall": "交互式卸载菜单",
@@ -4,7 +4,7 @@
4
4
  "emptyToSkip": "(空内容回车则跳过)",
5
5
  "cancelled": "操作已取消",
6
6
  "error": "错误",
7
- "complete": "🎉 配置完成!使用 'claude' 命令开始体验。",
7
+ "complete": "🎉 配置完成!使用 '{{runtime}}' 命令开始体验。",
8
8
  "none": "无",
9
9
  "enterChoice": "请输入选项,回车确认(不区分大小写)",
10
10
  "invalidChoice": "无效选择。请输入有效选项。",
@@ -13,7 +13,7 @@
13
13
  "customModelSkipped": "已跳过自定义模型配置",
14
14
  "currentLanguage": "当前语言",
15
15
  "currentModel": "当前模型",
16
- "defaultModelOption": "默认 - 让 Claude Code 自动选择",
16
+ "defaultModelOption": "默认 - 让 {{runtime}} 自动选择",
17
17
  "defaultStyle": "默认风格",
18
18
  "enterHaikuModel": "请输入默认 Haiku 模型名称",
19
19
  "enterSonnetModel": "请输入默认 Sonnet 模型名称",
@@ -74,7 +74,7 @@
74
74
  "singleConfigSaved": "配置 {{name}} 已保存",
75
75
  "singleConfigSaveFailed": "配置保存失败",
76
76
  "updateDocsOnly": "仅更新工作流相关md并备份旧配置",
77
- "updatingPrompts": "正在更新 Claude Code 记忆文档...",
77
+ "updatingPrompts": "正在更新 {{runtime}} 记忆文档...",
78
78
  "enterCustomModel": "请输入自定义模型名称",
79
79
  "systemPromptConfigured": "系统提示词风格已配置",
80
80
  "codexModelOptions.gpt51CodexMax": "GPT-5.1-Codex-Max - Codex 优化旗舰模型,支持深度快速推理",
@@ -1,4 +1,8 @@
1
1
  {
2
+ "clavueInstallPrompt": "检测到 Clavue 未安装,是否自动安装?",
3
+ "clavueInstallSuccess": "Clavue 安装成功",
4
+ "clavueNotInstalledHint": "Clavue 未安装。请运行: npm install -g clavue",
5
+ "installingClavue": "正在安装 Clavue...",
2
6
  "alreadyInstalled": "Claude Code 已安装",
3
7
  "installFailed": "Claude Code 安装失败",
4
8
  "installPrompt": "检测到 Claude Code 未安装,是否自动安装?",
@@ -36,7 +36,12 @@
36
36
  "menuOptions.codexUninstall": "卸载 Codex",
37
37
  "menuOptions.codexCheckUpdates": "检查 Codex 更新",
38
38
  "menuSections.otherTools": "其他工具",
39
- "menuDescriptions.switchCodeTool": "在支持的代码工具之间切换 (Claude Code, Codex)",
39
+ "menuDescriptions.switchCodeTool": " Clavue / Claude Code / Codex / Grok CLI 之间切换",
40
+ "menuOptions.grokInit": "配置 API / Profile",
41
+ "menuOptions.grokStatus": "状态与启动",
42
+ "menuDescriptions.grokInit": "保存 Grok 可用的 ccjk profile(API Key + 模型)",
43
+ "menuDescriptions.grokStatus": "检测 Grok CLI 安装与登录,查看启动命令",
44
+ "menuDescriptions.grokInitHint": "配置完成后可运行: ccjk grok <profile>",
40
45
  "menuDescriptions.codexFullInit": "安装 Codex + 导入工作流 + 配置 API + 配置 MCP 服务",
41
46
  "menuDescriptions.codexImportWorkflow": "仅导入/更新 Codex 工作流相关文件",
42
47
  "menuDescriptions.codexConfigureApi": "配置 Codex 的 API 提供商",
@@ -45,6 +50,26 @@
45
50
  "menuDescriptions.codexConfigureAiMemory": "配置 AI 输出语言和系统提示词风格",
46
51
  "menuDescriptions.codexUninstall": "删除 Codex 配置和相关文件",
47
52
  "menuDescriptions.codexCheckUpdates": "检查并更新 Codex",
53
+ "menuOptions.clavueFullInit": "设置 Clavue",
54
+ "menuOptions.clavueUpdateWorkflow": "更新 Clavue",
55
+ "menuOptions.clavueConfigureApi": "配置 API",
56
+ "menuOptions.clavueConfigureMcp": "配置 MCP",
57
+ "menuOptions.clavueConfigureModel": "配置默认模型",
58
+ "menuOptions.clavueConfigureAiMemory": "配置 AI 记忆",
59
+ "menuOptions.clavueConfigureEnvPermission": "环境变量与权限",
60
+ "menuOptions.clavueStatus": "状态探活",
61
+ "menuOptions.clavueUninstall": "卸载 Clavue 配置",
62
+ "menuOptions.clavueCheckUpdates": "检查 Clavue 更新",
63
+ "menuDescriptions.clavueFullInit": "完整初始化 Clavue(工作流 + API + MCP + 权限)",
64
+ "menuDescriptions.clavueUpdateWorkflow": "更新 Clavue 工作流与模板文件",
65
+ "menuDescriptions.clavueConfigureApi": "配置 Clavue 的 API URL、Key 或 CCR 代理",
66
+ "menuDescriptions.clavueConfigureMcp": "配置 Clavue 的 MCP 服务",
67
+ "menuDescriptions.clavueConfigureModel": "设置 Clavue 默认模型",
68
+ "menuDescriptions.clavueConfigureAiMemory": "配置 Clavue 的 AI 输出语言与风格",
69
+ "menuDescriptions.clavueConfigureEnvPermission": "导入 Clavue 推荐环境变量与权限",
70
+ "menuDescriptions.clavueStatus": "探活当前 Clavue API 配置",
71
+ "menuDescriptions.clavueUninstall": "删除 ~/.clavue 配置与相关文件",
72
+ "menuDescriptions.clavueCheckUpdates": "检查并更新 Clavue、CCR 和 CCometixLine",
48
73
  "switchCodeToolPrompt": "请选择代码工具类型",
49
74
  "codeToolSwitched": "已切换为 {{tool}}",
50
75
  "selectFunction": "请选择功能"
@@ -14,7 +14,7 @@
14
14
  "failedToSwitchToCcr": "切换到 CCR 代理失败:{error}",
15
15
  "successfullySwitchedToProfile": "成功切换到配置文件:{{name}}",
16
16
  "failedToSwitchToProfile": "切换到配置文件失败:{{error}}",
17
- "incrementalManagementTitle": "📋 Claude Code 配置管理",
17
+ "incrementalManagementTitle": "📋 {{runtime}} 配置管理",
18
18
  "currentProfileCount": "当前配置数量:{{count}}",
19
19
  "currentDefaultProfile": "当前默认配置:{{profile}}",
20
20
  "addProfile": "添加配置",
package/dist/index.d.mts CHANGED
@@ -2,6 +2,8 @@ declare const CLAUDE_DIR: string;
2
2
  declare const SETTINGS_FILE: string;
3
3
  declare const CLAVUE_DIR: string;
4
4
  declare const CLAVUE_SETTINGS_FILE: string;
5
+ declare const CLAVUE_CONFIG_FILE: string;
6
+ declare const CLAVUE_MD_FILE: string;
5
7
  declare const CLAUDE_MD_FILE: string;
6
8
  declare const ClAUDE_CONFIG_FILE: string;
7
9
  declare const CLAUDE_VSC_CONFIG_FILE: string;
@@ -12,8 +14,9 @@ declare const CODEX_AGENTS_FILE: string;
12
14
  declare const CODEX_PROMPTS_DIR: string;
13
15
  declare const CCJK_CONFIG_DIR: string;
14
16
  declare const CCJK_CONFIG_FILE: string;
17
+ /** 旧版配置路径(仅用于 migrate,不含当前 canonical ~/.ccjk/config.toml) */
15
18
  declare const LEGACY_CCJK_CONFIG_FILES: string[];
16
- declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex"];
19
+ declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex", "grok"];
17
20
  type CodeToolType = (typeof CODE_TOOL_TYPES)[number];
18
21
  declare const DEFAULT_CODE_TOOL_TYPE: CodeToolType;
19
22
  declare const CODE_TOOL_BANNERS: Record<CodeToolType, string>;
@@ -109,14 +112,14 @@ interface ClaudeConfiguration {
109
112
  installMethod?: InstallMethod$1;
110
113
  }
111
114
 
112
- declare function getMcpConfigPath(): string;
113
- declare function readMcpConfig(): ClaudeConfiguration | null;
114
- declare function writeMcpConfig(config: ClaudeConfiguration): void;
115
- declare function backupMcpConfig(): string | null;
115
+ declare function getMcpConfigPath(codeTool?: CodeToolType): string;
116
+ declare function readMcpConfig(codeTool?: CodeToolType): ClaudeConfiguration | null;
117
+ declare function writeMcpConfig(config: ClaudeConfiguration, codeTool?: CodeToolType): void;
118
+ declare function backupMcpConfig(codeTool?: CodeToolType): string | null;
116
119
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
117
120
  declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
118
121
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
119
- declare function addCompletedOnboarding(): void;
122
+ declare function addCompletedOnboarding(codeTool?: CodeToolType): void;
120
123
  /**
121
124
  * Ensures that an API key is in the approved list and not in the rejected list
122
125
  * @param config - Claude configuration object
@@ -135,13 +138,13 @@ declare function removeApiKeyFromRejected(config: ClaudeConfiguration, apiKey: s
135
138
  * Manages API key approval status by reading config, updating it, and writing it back
136
139
  * @param apiKey - The API key to ensure is approved (e.g., 'sk-ccjk-x-ccr')
137
140
  */
138
- declare function manageApiKeyApproval(apiKey: string): void;
141
+ declare function manageApiKeyApproval(apiKey: string, codeTool?: CodeToolType): void;
139
142
  /**
140
143
  * Sets the primaryApiKey field in ~/.claude/config.json (VSCode extension config)
141
144
  * This is required for Claude Code 2.0 to properly recognize third-party API configurations
142
145
  * and prevent redirecting to official login page
143
146
  */
144
- declare function setPrimaryApiKey(): void;
147
+ declare function setPrimaryApiKey(codeTool?: CodeToolType): void;
145
148
 
146
149
  /**
147
150
  * API configuration for Claude Code
@@ -156,10 +159,12 @@ interface ApiConfig {
156
159
  */
157
160
  type InstallMethod = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd';
158
161
 
159
- declare function ensureClaudeDir(): void;
160
- declare function backupExistingConfig(): string | null;
161
- declare function copyConfigFiles(onlyMd?: boolean): void;
162
- declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
162
+ declare function activeSettingsFile(codeTool?: CodeToolType): string;
163
+
164
+ declare function ensureClaudeDir(codeTool?: CodeToolType): void;
165
+ declare function backupExistingConfig(codeTool?: CodeToolType): string | null;
166
+ declare function copyConfigFiles(onlyMd?: boolean, codeTool?: CodeToolType): void;
167
+ declare function configureApi(apiConfig: ApiConfig | null, codeTool?: CodeToolType): ApiConfig | null;
163
168
  declare function mergeConfigs(sourceFile: string, targetFile: string): void;
164
169
  /**
165
170
  * Update custom model configuration using environment variables
@@ -168,33 +173,33 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
168
173
  * @param sonnetModel - Default Sonnet model (optional)
169
174
  * @param opusModel - Default Opus model (optional)
170
175
  */
171
- declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
176
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string, codeTool?: CodeToolType): void;
172
177
  /**
173
178
  * Update the default model configuration in settings.json
174
179
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
175
180
  * Note: 'custom' model type is handled differently - it should use environment variables instead
176
181
  */
177
- declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom'): void;
182
+ declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom', codeTool?: CodeToolType): void;
178
183
  /**
179
184
  * Merge settings.json intelligently
180
185
  * Preserves user's environment variables and custom configurations
181
186
  */
182
- declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
187
+ declare function mergeSettingsFile(templatePath: string, targetPath: string, codeTool?: CodeToolType): void;
183
188
  /**
184
189
  * Get existing model configuration from settings.json
185
190
  */
186
- declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
191
+ declare function getExistingModelConfig(codeTool?: CodeToolType): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
187
192
  /**
188
193
  * Get existing API configuration from settings.json
189
194
  */
190
- declare function getExistingApiConfig(): ApiConfig | null;
191
- declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string): void;
195
+ declare function getExistingApiConfig(codeTool?: CodeToolType): ApiConfig | null;
196
+ declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string, codeTool?: CodeToolType): void;
192
197
  /**
193
198
  * Switch to official login mode - remove all third-party API configurations
194
199
  * Removes: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY from settings.json
195
200
  * Removes: primaryApiKey from ~/.claude/config.json
196
201
  */
197
- declare function switchToOfficialLogin(): boolean;
202
+ declare function switchToOfficialLogin(codeTool?: CodeToolType): boolean;
198
203
  /**
199
204
  * Prompt user for API configuration action when existing config is found
200
205
  * Returns the user's choice for how to handle existing configuration
@@ -316,9 +321,9 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
316
321
  */
317
322
  declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
318
323
 
319
- declare function importRecommendedEnv(): Promise<void>;
320
- declare function importRecommendedPermissions(): Promise<void>;
321
- declare function openSettingsJson(): Promise<void>;
324
+ declare function importRecommendedEnv(codeTool?: CodeToolType): Promise<void>;
325
+ declare function importRecommendedPermissions(codeTool?: CodeToolType): Promise<void>;
326
+ declare function openSettingsJson(codeTool?: CodeToolType): Promise<void>;
322
327
 
323
- export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CLAVUE_DIR, CLAVUE_SETTINGS_FILE, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_CCJK_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, ensureApiKeyApproved, ensureClaudeDir, executeInstallMethod, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, handleInstallFailure, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installCodex, isClaudeCodeInstalled, isCodeToolType, isCodexInstalled, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, selectInstallMethod, setInstallMethod, setPrimaryApiKey, settingsFileForTool, switchToOfficialLogin, uninstallCodeTool, updateCustomModel, updateDefaultModel, verifyInstallation, writeMcpConfig };
328
+ export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CLAVUE_CONFIG_FILE, CLAVUE_DIR, CLAVUE_MD_FILE, CLAVUE_SETTINGS_FILE, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_CCJK_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, activeSettingsFile, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, ensureApiKeyApproved, ensureClaudeDir, executeInstallMethod, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, handleInstallFailure, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installCodex, isClaudeCodeInstalled, isCodeToolType, isCodexInstalled, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, selectInstallMethod, setInstallMethod, setPrimaryApiKey, settingsFileForTool, switchToOfficialLogin, uninstallCodeTool, updateCustomModel, updateDefaultModel, verifyInstallation, writeMcpConfig };
324
329
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, CodeToolType, InstallationStatus, McpServerConfig, McpService, SupportedLang, VerificationResult };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ declare const CLAUDE_DIR: string;
2
2
  declare const SETTINGS_FILE: string;
3
3
  declare const CLAVUE_DIR: string;
4
4
  declare const CLAVUE_SETTINGS_FILE: string;
5
+ declare const CLAVUE_CONFIG_FILE: string;
6
+ declare const CLAVUE_MD_FILE: string;
5
7
  declare const CLAUDE_MD_FILE: string;
6
8
  declare const ClAUDE_CONFIG_FILE: string;
7
9
  declare const CLAUDE_VSC_CONFIG_FILE: string;
@@ -12,8 +14,9 @@ declare const CODEX_AGENTS_FILE: string;
12
14
  declare const CODEX_PROMPTS_DIR: string;
13
15
  declare const CCJK_CONFIG_DIR: string;
14
16
  declare const CCJK_CONFIG_FILE: string;
17
+ /** 旧版配置路径(仅用于 migrate,不含当前 canonical ~/.ccjk/config.toml) */
15
18
  declare const LEGACY_CCJK_CONFIG_FILES: string[];
16
- declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex"];
19
+ declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex", "grok"];
17
20
  type CodeToolType = (typeof CODE_TOOL_TYPES)[number];
18
21
  declare const DEFAULT_CODE_TOOL_TYPE: CodeToolType;
19
22
  declare const CODE_TOOL_BANNERS: Record<CodeToolType, string>;
@@ -109,14 +112,14 @@ interface ClaudeConfiguration {
109
112
  installMethod?: InstallMethod$1;
110
113
  }
111
114
 
112
- declare function getMcpConfigPath(): string;
113
- declare function readMcpConfig(): ClaudeConfiguration | null;
114
- declare function writeMcpConfig(config: ClaudeConfiguration): void;
115
- declare function backupMcpConfig(): string | null;
115
+ declare function getMcpConfigPath(codeTool?: CodeToolType): string;
116
+ declare function readMcpConfig(codeTool?: CodeToolType): ClaudeConfiguration | null;
117
+ declare function writeMcpConfig(config: ClaudeConfiguration, codeTool?: CodeToolType): void;
118
+ declare function backupMcpConfig(codeTool?: CodeToolType): string | null;
116
119
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
117
120
  declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
118
121
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
119
- declare function addCompletedOnboarding(): void;
122
+ declare function addCompletedOnboarding(codeTool?: CodeToolType): void;
120
123
  /**
121
124
  * Ensures that an API key is in the approved list and not in the rejected list
122
125
  * @param config - Claude configuration object
@@ -135,13 +138,13 @@ declare function removeApiKeyFromRejected(config: ClaudeConfiguration, apiKey: s
135
138
  * Manages API key approval status by reading config, updating it, and writing it back
136
139
  * @param apiKey - The API key to ensure is approved (e.g., 'sk-ccjk-x-ccr')
137
140
  */
138
- declare function manageApiKeyApproval(apiKey: string): void;
141
+ declare function manageApiKeyApproval(apiKey: string, codeTool?: CodeToolType): void;
139
142
  /**
140
143
  * Sets the primaryApiKey field in ~/.claude/config.json (VSCode extension config)
141
144
  * This is required for Claude Code 2.0 to properly recognize third-party API configurations
142
145
  * and prevent redirecting to official login page
143
146
  */
144
- declare function setPrimaryApiKey(): void;
147
+ declare function setPrimaryApiKey(codeTool?: CodeToolType): void;
145
148
 
146
149
  /**
147
150
  * API configuration for Claude Code
@@ -156,10 +159,12 @@ interface ApiConfig {
156
159
  */
157
160
  type InstallMethod = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd';
158
161
 
159
- declare function ensureClaudeDir(): void;
160
- declare function backupExistingConfig(): string | null;
161
- declare function copyConfigFiles(onlyMd?: boolean): void;
162
- declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
162
+ declare function activeSettingsFile(codeTool?: CodeToolType): string;
163
+
164
+ declare function ensureClaudeDir(codeTool?: CodeToolType): void;
165
+ declare function backupExistingConfig(codeTool?: CodeToolType): string | null;
166
+ declare function copyConfigFiles(onlyMd?: boolean, codeTool?: CodeToolType): void;
167
+ declare function configureApi(apiConfig: ApiConfig | null, codeTool?: CodeToolType): ApiConfig | null;
163
168
  declare function mergeConfigs(sourceFile: string, targetFile: string): void;
164
169
  /**
165
170
  * Update custom model configuration using environment variables
@@ -168,33 +173,33 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
168
173
  * @param sonnetModel - Default Sonnet model (optional)
169
174
  * @param opusModel - Default Opus model (optional)
170
175
  */
171
- declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
176
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string, codeTool?: CodeToolType): void;
172
177
  /**
173
178
  * Update the default model configuration in settings.json
174
179
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
175
180
  * Note: 'custom' model type is handled differently - it should use environment variables instead
176
181
  */
177
- declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom'): void;
182
+ declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom', codeTool?: CodeToolType): void;
178
183
  /**
179
184
  * Merge settings.json intelligently
180
185
  * Preserves user's environment variables and custom configurations
181
186
  */
182
- declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
187
+ declare function mergeSettingsFile(templatePath: string, targetPath: string, codeTool?: CodeToolType): void;
183
188
  /**
184
189
  * Get existing model configuration from settings.json
185
190
  */
186
- declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
191
+ declare function getExistingModelConfig(codeTool?: CodeToolType): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
187
192
  /**
188
193
  * Get existing API configuration from settings.json
189
194
  */
190
- declare function getExistingApiConfig(): ApiConfig | null;
191
- declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string): void;
195
+ declare function getExistingApiConfig(codeTool?: CodeToolType): ApiConfig | null;
196
+ declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string, codeTool?: CodeToolType): void;
192
197
  /**
193
198
  * Switch to official login mode - remove all third-party API configurations
194
199
  * Removes: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY from settings.json
195
200
  * Removes: primaryApiKey from ~/.claude/config.json
196
201
  */
197
- declare function switchToOfficialLogin(): boolean;
202
+ declare function switchToOfficialLogin(codeTool?: CodeToolType): boolean;
198
203
  /**
199
204
  * Prompt user for API configuration action when existing config is found
200
205
  * Returns the user's choice for how to handle existing configuration
@@ -316,9 +321,9 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
316
321
  */
317
322
  declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
318
323
 
319
- declare function importRecommendedEnv(): Promise<void>;
320
- declare function importRecommendedPermissions(): Promise<void>;
321
- declare function openSettingsJson(): Promise<void>;
324
+ declare function importRecommendedEnv(codeTool?: CodeToolType): Promise<void>;
325
+ declare function importRecommendedPermissions(codeTool?: CodeToolType): Promise<void>;
326
+ declare function openSettingsJson(codeTool?: CodeToolType): Promise<void>;
322
327
 
323
- export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CLAVUE_DIR, CLAVUE_SETTINGS_FILE, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_CCJK_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, ensureApiKeyApproved, ensureClaudeDir, executeInstallMethod, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, handleInstallFailure, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installCodex, isClaudeCodeInstalled, isCodeToolType, isCodexInstalled, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, selectInstallMethod, setInstallMethod, setPrimaryApiKey, settingsFileForTool, switchToOfficialLogin, uninstallCodeTool, updateCustomModel, updateDefaultModel, verifyInstallation, writeMcpConfig };
328
+ export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CLAVUE_CONFIG_FILE, CLAVUE_DIR, CLAVUE_MD_FILE, CLAVUE_SETTINGS_FILE, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_CCJK_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, activeSettingsFile, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, createHomebrewSymlink, detectInstalledVersion, displayVerificationResult, ensureApiKeyApproved, ensureClaudeDir, executeInstallMethod, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, handleInstallFailure, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installCodex, isClaudeCodeInstalled, isCodeToolType, isCodexInstalled, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, selectInstallMethod, setInstallMethod, setPrimaryApiKey, settingsFileForTool, switchToOfficialLogin, uninstallCodeTool, updateCustomModel, updateDefaultModel, verifyInstallation, writeMcpConfig };
324
329
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, CodeToolType, InstallationStatus, McpServerConfig, McpService, SupportedLang, VerificationResult };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AI_OUTPUT_LANGUAGES, a as API_DEFAULT_URL, b as API_ENV_KEY, C as CCJK_CONFIG_DIR, c as CCJK_CONFIG_FILE, d as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as CLAUDE_VSC_CONFIG_FILE, g as CLAVUE_DIR, h as CLAVUE_SETTINGS_FILE, i as CODEX_AGENTS_FILE, j as CODEX_AUTH_FILE, k as CODEX_CONFIG_FILE, l as CODEX_DIR, m as CODEX_PROMPTS_DIR, n as CODE_TOOL_ALIASES, o as CODE_TOOL_BANNERS, p as CODE_TOOL_TYPES, q as ClAUDE_CONFIG_FILE, D as DEFAULT_CODE_TOOL_TYPE, L as LANG_LABELS, r as LEGACY_CCJK_CONFIG_FILES, S as SETTINGS_FILE, s as SUPPORTED_LANGS, t as addCompletedOnboarding, u as applyAiLanguageDirective, v as backupExistingConfig, w as backupMcpConfig, x as buildMcpServerConfig, y as cleanupPermissions, z as commandExists, B as configureApi, E as copyConfigFiles, F as createHomebrewSymlink, G as detectInstalledVersion, H as displayVerificationResult, I as ensureApiKeyApproved, J as ensureClaudeDir, K as executeInstallMethod, M as fixWindowsMcpConfig, N as getAiOutputLanguageLabel, O as getExistingApiConfig, P as getExistingModelConfig, Q as getInstallationStatus, R as getMcpConfigPath, T as getPlatform, U as handleInstallFailure, V as importRecommendedEnv, W as importRecommendedPermissions, X as init, Y as installClaudeCode, Z as installCodex, _ as isClaudeCodeInstalled, $ as isCodeToolType, a0 as isCodexInstalled, a1 as isLocalClaudeCodeInstalled, a2 as manageApiKeyApproval, a3 as mergeAndCleanPermissions, a4 as mergeConfigs, a5 as mergeMcpServers, a6 as mergeSettingsFile, a7 as openSettingsJson, a8 as promptApiConfigurationAction, a9 as readMcpConfig, aa as removeApiKeyFromRejected, ab as removeLocalClaudeCode, ac as resolveCodeToolType, ad as selectInstallMethod, ae as setInstallMethod, af as setPrimaryApiKey, ag as settingsFileForTool, ah as switchToOfficialLogin, ai as uninstallCodeTool, aj as updateCustomModel, ak as updateDefaultModel, al as verifyInstallation, am as writeMcpConfig } from './chunks/simple-config.mjs';
1
+ export { A as AI_OUTPUT_LANGUAGES, a as API_DEFAULT_URL, b as API_ENV_KEY, C as CCJK_CONFIG_DIR, c as CCJK_CONFIG_FILE, d as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as CLAUDE_VSC_CONFIG_FILE, g as CLAVUE_CONFIG_FILE, h as CLAVUE_DIR, i as CLAVUE_MD_FILE, j as CLAVUE_SETTINGS_FILE, k as CODEX_AGENTS_FILE, l as CODEX_AUTH_FILE, m as CODEX_CONFIG_FILE, n as CODEX_DIR, o as CODEX_PROMPTS_DIR, p as CODE_TOOL_ALIASES, q as CODE_TOOL_BANNERS, r as CODE_TOOL_TYPES, s as ClAUDE_CONFIG_FILE, D as DEFAULT_CODE_TOOL_TYPE, L as LANG_LABELS, t as LEGACY_CCJK_CONFIG_FILES, S as SETTINGS_FILE, u as SUPPORTED_LANGS, v as activeSettingsFile, w as addCompletedOnboarding, x as applyAiLanguageDirective, y as backupExistingConfig, z as backupMcpConfig, B as buildMcpServerConfig, E as cleanupPermissions, F as commandExists, G as configureApi, H as copyConfigFiles, I as createHomebrewSymlink, J as detectInstalledVersion, K as displayVerificationResult, M as ensureApiKeyApproved, N as ensureClaudeDir, O as executeInstallMethod, P as fixWindowsMcpConfig, Q as getAiOutputLanguageLabel, R as getExistingApiConfig, T as getExistingModelConfig, U as getInstallationStatus, V as getMcpConfigPath, W as getPlatform, X as handleInstallFailure, Y as importRecommendedEnv, Z as importRecommendedPermissions, _ as init, $ as installClaudeCode, a0 as installCodex, a1 as isClaudeCodeInstalled, a2 as isCodeToolType, a3 as isCodexInstalled, a4 as isLocalClaudeCodeInstalled, a5 as manageApiKeyApproval, a6 as mergeAndCleanPermissions, a7 as mergeConfigs, a8 as mergeMcpServers, a9 as mergeSettingsFile, aa as openSettingsJson, ab as promptApiConfigurationAction, ac as readMcpConfig, ad as removeApiKeyFromRejected, ae as removeLocalClaudeCode, af as resolveCodeToolType, ag as selectInstallMethod, ah as setInstallMethod, ai as setPrimaryApiKey, aj as settingsFileForTool, ak as switchToOfficialLogin, al as uninstallCodeTool, am as updateCustomModel, an as updateDefaultModel, ao as verifyInstallation, ap as writeMcpConfig } from './chunks/simple-config.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:process';
4
4
  import 'ansis';
@@ -9,7 +9,6 @@ import 'node:util';
9
9
  import 'dayjs';
10
10
  import 'pathe';
11
11
  import 'node:url';
12
- import '@rainbowatcher/toml-edit-js';
13
12
  import 'inquirer-toggle';
14
13
  import 'ora';
15
14
  import 'tinyexec';
@@ -17,3 +16,4 @@ import 'semver';
17
16
  import 'node:fs/promises';
18
17
  import 'i18next';
19
18
  import 'i18next-fs-backend';
19
+ import '@rainbowatcher/toml-edit-js';
@@ -0,0 +1,7 @@
1
+ import { aw as resolveClaudeFamilySettingsTarget } from '../chunks/simple-config.mjs';
2
+
3
+ function getClaudeFamilyRuntimeLabel(tool) {
4
+ return resolveClaudeFamilySettingsTarget(tool).displayName;
5
+ }
6
+
7
+ export { getClaudeFamilyRuntimeLabel as g };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
- "version": "16.0.0-alpha.3",
4
- "description": "Clavue / Claude Code / Codex / Grok CLI 统一配置工具(基于 ZCF 交互与配置方法)",
3
+ "version": "16.0.2",
4
+ "description": "Clavue / Claude Code / Codex / Grok CLI 统一配置工具(ccjk 交互与配置方法)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "ccjk": "bin/ccjk.mjs"