ccjk 16.0.1 → 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.
- package/dist/chunks/claude-code-config-manager.mjs +18 -14
- package/dist/chunks/claude-code-incremental-manager.mjs +5 -3
- package/dist/chunks/codex-config-switch.mjs +4 -4
- package/dist/chunks/codex-provider-manager.mjs +5 -5
- package/dist/chunks/codex-uninstaller.mjs +3 -3
- package/dist/chunks/commands.mjs +2 -2
- package/dist/chunks/features.mjs +43 -31
- package/dist/chunks/simple-config.mjs +593 -411
- package/dist/cli.mjs +423 -17
- package/dist/i18n/locales/en/cli.json +1 -1
- package/dist/i18n/locales/en/common.json +1 -1
- package/dist/i18n/locales/en/configuration.json +2 -2
- package/dist/i18n/locales/en/installation.json +4 -0
- package/dist/i18n/locales/en/menu.json +26 -1
- package/dist/i18n/locales/en/multi-config.json +1 -1
- package/dist/i18n/locales/zh-CN/cli.json +1 -1
- package/dist/i18n/locales/zh-CN/common.json +1 -1
- package/dist/i18n/locales/zh-CN/configuration.json +2 -2
- package/dist/i18n/locales/zh-CN/installation.json +4 -0
- package/dist/i18n/locales/zh-CN/menu.json +26 -1
- package/dist/i18n/locales/zh-CN/multi-config.json +1 -1
- package/dist/index.d.mts +27 -23
- package/dist/index.d.ts +27 -23
- package/dist/index.mjs +2 -2
- package/dist/shared/ccjk.BSLlI-JL.mjs +7 -0
- package/package.json +1 -1
|
@@ -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": "
|
|
49
|
+
"banner.subtitle": "四工具统一配置",
|
|
50
50
|
"banner.updateSubtitle": "更新 Claude Code 配置",
|
|
51
51
|
"help.defaults.dailyUsage": "每日用量(默认)",
|
|
52
52
|
"help.defaults.interactiveUninstall": "交互式卸载菜单",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"customModelSkipped": "已跳过自定义模型配置",
|
|
14
14
|
"currentLanguage": "当前语言",
|
|
15
15
|
"currentModel": "当前模型",
|
|
16
|
-
"defaultModelOption": "默认 - 让
|
|
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": "正在更新
|
|
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": "
|
|
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": "📋
|
|
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;
|
|
@@ -14,7 +16,7 @@ declare const CCJK_CONFIG_DIR: string;
|
|
|
14
16
|
declare const CCJK_CONFIG_FILE: string;
|
|
15
17
|
/** 旧版配置路径(仅用于 migrate,不含当前 canonical ~/.ccjk/config.toml) */
|
|
16
18
|
declare const LEGACY_CCJK_CONFIG_FILES: string[];
|
|
17
|
-
declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex"];
|
|
19
|
+
declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex", "grok"];
|
|
18
20
|
type CodeToolType = (typeof CODE_TOOL_TYPES)[number];
|
|
19
21
|
declare const DEFAULT_CODE_TOOL_TYPE: CodeToolType;
|
|
20
22
|
declare const CODE_TOOL_BANNERS: Record<CodeToolType, string>;
|
|
@@ -110,14 +112,14 @@ interface ClaudeConfiguration {
|
|
|
110
112
|
installMethod?: InstallMethod$1;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
|
-
declare function getMcpConfigPath(): string;
|
|
114
|
-
declare function readMcpConfig(): ClaudeConfiguration | null;
|
|
115
|
-
declare function writeMcpConfig(config: ClaudeConfiguration): void;
|
|
116
|
-
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;
|
|
117
119
|
declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
|
|
118
120
|
declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
|
|
119
121
|
declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
|
|
120
|
-
declare function addCompletedOnboarding(): void;
|
|
122
|
+
declare function addCompletedOnboarding(codeTool?: CodeToolType): void;
|
|
121
123
|
/**
|
|
122
124
|
* Ensures that an API key is in the approved list and not in the rejected list
|
|
123
125
|
* @param config - Claude configuration object
|
|
@@ -136,13 +138,13 @@ declare function removeApiKeyFromRejected(config: ClaudeConfiguration, apiKey: s
|
|
|
136
138
|
* Manages API key approval status by reading config, updating it, and writing it back
|
|
137
139
|
* @param apiKey - The API key to ensure is approved (e.g., 'sk-ccjk-x-ccr')
|
|
138
140
|
*/
|
|
139
|
-
declare function manageApiKeyApproval(apiKey: string): void;
|
|
141
|
+
declare function manageApiKeyApproval(apiKey: string, codeTool?: CodeToolType): void;
|
|
140
142
|
/**
|
|
141
143
|
* Sets the primaryApiKey field in ~/.claude/config.json (VSCode extension config)
|
|
142
144
|
* This is required for Claude Code 2.0 to properly recognize third-party API configurations
|
|
143
145
|
* and prevent redirecting to official login page
|
|
144
146
|
*/
|
|
145
|
-
declare function setPrimaryApiKey(): void;
|
|
147
|
+
declare function setPrimaryApiKey(codeTool?: CodeToolType): void;
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* API configuration for Claude Code
|
|
@@ -157,10 +159,12 @@ interface ApiConfig {
|
|
|
157
159
|
*/
|
|
158
160
|
type InstallMethod = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd';
|
|
159
161
|
|
|
160
|
-
declare function
|
|
161
|
-
|
|
162
|
-
declare function
|
|
163
|
-
declare function
|
|
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;
|
|
164
168
|
declare function mergeConfigs(sourceFile: string, targetFile: string): void;
|
|
165
169
|
/**
|
|
166
170
|
* Update custom model configuration using environment variables
|
|
@@ -169,33 +173,33 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
|
|
|
169
173
|
* @param sonnetModel - Default Sonnet model (optional)
|
|
170
174
|
* @param opusModel - Default Opus model (optional)
|
|
171
175
|
*/
|
|
172
|
-
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;
|
|
173
177
|
/**
|
|
174
178
|
* Update the default model configuration in settings.json
|
|
175
179
|
* @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
|
|
176
180
|
* Note: 'custom' model type is handled differently - it should use environment variables instead
|
|
177
181
|
*/
|
|
178
|
-
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;
|
|
179
183
|
/**
|
|
180
184
|
* Merge settings.json intelligently
|
|
181
185
|
* Preserves user's environment variables and custom configurations
|
|
182
186
|
*/
|
|
183
|
-
declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
|
|
187
|
+
declare function mergeSettingsFile(templatePath: string, targetPath: string, codeTool?: CodeToolType): void;
|
|
184
188
|
/**
|
|
185
189
|
* Get existing model configuration from settings.json
|
|
186
190
|
*/
|
|
187
|
-
declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
|
|
191
|
+
declare function getExistingModelConfig(codeTool?: CodeToolType): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
|
|
188
192
|
/**
|
|
189
193
|
* Get existing API configuration from settings.json
|
|
190
194
|
*/
|
|
191
|
-
declare function getExistingApiConfig(): ApiConfig | null;
|
|
192
|
-
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;
|
|
193
197
|
/**
|
|
194
198
|
* Switch to official login mode - remove all third-party API configurations
|
|
195
199
|
* Removes: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY from settings.json
|
|
196
200
|
* Removes: primaryApiKey from ~/.claude/config.json
|
|
197
201
|
*/
|
|
198
|
-
declare function switchToOfficialLogin(): boolean;
|
|
202
|
+
declare function switchToOfficialLogin(codeTool?: CodeToolType): boolean;
|
|
199
203
|
/**
|
|
200
204
|
* Prompt user for API configuration action when existing config is found
|
|
201
205
|
* Returns the user's choice for how to handle existing configuration
|
|
@@ -317,9 +321,9 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
|
|
|
317
321
|
*/
|
|
318
322
|
declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
|
|
319
323
|
|
|
320
|
-
declare function importRecommendedEnv(): Promise<void>;
|
|
321
|
-
declare function importRecommendedPermissions(): Promise<void>;
|
|
322
|
-
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>;
|
|
323
327
|
|
|
324
|
-
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 };
|
|
325
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;
|
|
@@ -14,7 +16,7 @@ declare const CCJK_CONFIG_DIR: string;
|
|
|
14
16
|
declare const CCJK_CONFIG_FILE: string;
|
|
15
17
|
/** 旧版配置路径(仅用于 migrate,不含当前 canonical ~/.ccjk/config.toml) */
|
|
16
18
|
declare const LEGACY_CCJK_CONFIG_FILES: string[];
|
|
17
|
-
declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex"];
|
|
19
|
+
declare const CODE_TOOL_TYPES: readonly ["clavue", "claude-code", "codex", "grok"];
|
|
18
20
|
type CodeToolType = (typeof CODE_TOOL_TYPES)[number];
|
|
19
21
|
declare const DEFAULT_CODE_TOOL_TYPE: CodeToolType;
|
|
20
22
|
declare const CODE_TOOL_BANNERS: Record<CodeToolType, string>;
|
|
@@ -110,14 +112,14 @@ interface ClaudeConfiguration {
|
|
|
110
112
|
installMethod?: InstallMethod$1;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
|
-
declare function getMcpConfigPath(): string;
|
|
114
|
-
declare function readMcpConfig(): ClaudeConfiguration | null;
|
|
115
|
-
declare function writeMcpConfig(config: ClaudeConfiguration): void;
|
|
116
|
-
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;
|
|
117
119
|
declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
|
|
118
120
|
declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
|
|
119
121
|
declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
|
|
120
|
-
declare function addCompletedOnboarding(): void;
|
|
122
|
+
declare function addCompletedOnboarding(codeTool?: CodeToolType): void;
|
|
121
123
|
/**
|
|
122
124
|
* Ensures that an API key is in the approved list and not in the rejected list
|
|
123
125
|
* @param config - Claude configuration object
|
|
@@ -136,13 +138,13 @@ declare function removeApiKeyFromRejected(config: ClaudeConfiguration, apiKey: s
|
|
|
136
138
|
* Manages API key approval status by reading config, updating it, and writing it back
|
|
137
139
|
* @param apiKey - The API key to ensure is approved (e.g., 'sk-ccjk-x-ccr')
|
|
138
140
|
*/
|
|
139
|
-
declare function manageApiKeyApproval(apiKey: string): void;
|
|
141
|
+
declare function manageApiKeyApproval(apiKey: string, codeTool?: CodeToolType): void;
|
|
140
142
|
/**
|
|
141
143
|
* Sets the primaryApiKey field in ~/.claude/config.json (VSCode extension config)
|
|
142
144
|
* This is required for Claude Code 2.0 to properly recognize third-party API configurations
|
|
143
145
|
* and prevent redirecting to official login page
|
|
144
146
|
*/
|
|
145
|
-
declare function setPrimaryApiKey(): void;
|
|
147
|
+
declare function setPrimaryApiKey(codeTool?: CodeToolType): void;
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* API configuration for Claude Code
|
|
@@ -157,10 +159,12 @@ interface ApiConfig {
|
|
|
157
159
|
*/
|
|
158
160
|
type InstallMethod = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd';
|
|
159
161
|
|
|
160
|
-
declare function
|
|
161
|
-
|
|
162
|
-
declare function
|
|
163
|
-
declare function
|
|
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;
|
|
164
168
|
declare function mergeConfigs(sourceFile: string, targetFile: string): void;
|
|
165
169
|
/**
|
|
166
170
|
* Update custom model configuration using environment variables
|
|
@@ -169,33 +173,33 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
|
|
|
169
173
|
* @param sonnetModel - Default Sonnet model (optional)
|
|
170
174
|
* @param opusModel - Default Opus model (optional)
|
|
171
175
|
*/
|
|
172
|
-
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;
|
|
173
177
|
/**
|
|
174
178
|
* Update the default model configuration in settings.json
|
|
175
179
|
* @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
|
|
176
180
|
* Note: 'custom' model type is handled differently - it should use environment variables instead
|
|
177
181
|
*/
|
|
178
|
-
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;
|
|
179
183
|
/**
|
|
180
184
|
* Merge settings.json intelligently
|
|
181
185
|
* Preserves user's environment variables and custom configurations
|
|
182
186
|
*/
|
|
183
|
-
declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
|
|
187
|
+
declare function mergeSettingsFile(templatePath: string, targetPath: string, codeTool?: CodeToolType): void;
|
|
184
188
|
/**
|
|
185
189
|
* Get existing model configuration from settings.json
|
|
186
190
|
*/
|
|
187
|
-
declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
|
|
191
|
+
declare function getExistingModelConfig(codeTool?: CodeToolType): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
|
|
188
192
|
/**
|
|
189
193
|
* Get existing API configuration from settings.json
|
|
190
194
|
*/
|
|
191
|
-
declare function getExistingApiConfig(): ApiConfig | null;
|
|
192
|
-
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;
|
|
193
197
|
/**
|
|
194
198
|
* Switch to official login mode - remove all third-party API configurations
|
|
195
199
|
* Removes: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY from settings.json
|
|
196
200
|
* Removes: primaryApiKey from ~/.claude/config.json
|
|
197
201
|
*/
|
|
198
|
-
declare function switchToOfficialLogin(): boolean;
|
|
202
|
+
declare function switchToOfficialLogin(codeTool?: CodeToolType): boolean;
|
|
199
203
|
/**
|
|
200
204
|
* Prompt user for API configuration action when existing config is found
|
|
201
205
|
* Returns the user's choice for how to handle existing configuration
|
|
@@ -317,9 +321,9 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
|
|
|
317
321
|
*/
|
|
318
322
|
declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
|
|
319
323
|
|
|
320
|
-
declare function importRecommendedEnv(): Promise<void>;
|
|
321
|
-
declare function importRecommendedPermissions(): Promise<void>;
|
|
322
|
-
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>;
|
|
323
327
|
|
|
324
|
-
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 };
|
|
325
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
|
|
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';
|