UNPKG

@yeepay/coderocket-mcp

Version:

CodeRocket MCP - Independent AI-powered code review server for Model Context Protocol

83 lines 2.01 kB
import { AIService } from '../types.js'; /** * 独立配置管理类 * * 支持多层级配置加载: * 1. 环境变量(最高优先级) * 2. 项目级 .env 文件 * 3. 全局 ~/.coderocket/env 文件 * 4. 默认值(最低优先级) */ export declare class ConfigManager { private static config; private static initialized; /** * 初始化配置系统 */ static initialize(force?: boolean): Promise<void>; /** * 检查是否已初始化(安全方法) */ static isInitialized(): boolean; /** * 加载默认配置 */ private static loadDefaults; private static loadGlobalConfig; /** * 加载项目配置文件 .env */ private static loadProjectConfig; /** * 加载环境变量(最高优先级) */ private static loadEnvironmentVariables; /** * 解析 .env 文件内容 */ static parseEnvContent(content: string): Record<string, string>; /** * 获取配置值 */ static get(key: string, defaultValue?: any): any; /** * 获取API密钥环境变量名 */ static getAPIKeyEnvVar(service: AIService): string; /** * 获取API密钥 */ static getAPIKey(service: AIService): string; /** * 获取AI服务配置 */ static getAIService(): AIService; /** * 获取超时配置 */ static getTimeout(): number; /** * 获取最大重试次数 */ static getMaxRetries(): number; /** * 是否启用自动切换 */ static isAutoSwitchEnabled(): boolean; /** * 获取AI服务语言设置 */ static getAILanguage(): string; /** * 获取安全的配置信息(隐藏敏感信息) */ private static getSafeConfig; /** * 获取配置文件路径(保持向后兼容) */ static getConfigPath(scope: string): { dir: string; file: string; }; } //# sourceMappingURL=ConfigManager.d.ts.map