Fully revised as requested: restored all required checks, improved compatibility, and converted all comments to English.

This commit is contained in:
He-Xun
2025-06-08 22:03:56 +08:00
committed by Ralph Khreish
parent 3e1b8b957e
commit 5359a33dca

View File

@@ -547,7 +547,7 @@ function isApiKeySet(providerName, session = null, projectRoot = null) {
* @returns {boolean} True if the key exists and is not a placeholder, false otherwise. * @returns {boolean} True if the key exists and is not a placeholder, false otherwise.
*/ */
function getMcpApiKeyStatus(providerName, projectRoot = null) { function getMcpApiKeyStatus(providerName, projectRoot = null) {
// 1. 恢复rootDir检查和警告 // 1. Restore rootDir check and warning
const rootDir = projectRoot || findProjectRoot(); const rootDir = projectRoot || findProjectRoot();
if (!rootDir) { if (!rootDir) {
console.warn( console.warn(
@@ -557,7 +557,7 @@ function getMcpApiKeyStatus(providerName, projectRoot = null) {
} }
const mcpConfigPath = path.join(rootDir, '.cursor', 'mcp.json'); const mcpConfigPath = path.join(rootDir, '.cursor', 'mcp.json');
// 2. 文件存在性检查,保留注释warn // 2. File existence check, keep the commented warn
if (!fs.existsSync(mcpConfigPath)) { if (!fs.existsSync(mcpConfigPath)) {
// console.warn(chalk.yellow('Warning: .cursor/mcp.json not found.')); // console.warn(chalk.yellow('Warning: .cursor/mcp.json not found.'));
return false; // File doesn't exist return false; // File doesn't exist