diff --git a/package.json b/package.json index 233c855a9..4504ad281 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@costrict/csc", - "version": "4.0.7", + "version": "4.0.8", "description": "CSC — CoStrict多模型终端 AI 编程助手,支持 Anthropic/OpenAI/Gemini/Grok 等多种 API 端点", "type": "module", diff --git a/scripts/defines.ts b/scripts/defines.ts index 3b90b0653..78619a072 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -7,7 +7,7 @@ */ export function getMacroDefines(): Record { return { - "MACRO.VERSION": JSON.stringify("4.0.7"), + "MACRO.VERSION": JSON.stringify("4.0.8"), "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()), "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""), "MACRO.ISSUES_EXPLAINER": JSON.stringify(""), diff --git a/src/utils/doctorDiagnostic.ts b/src/utils/doctorDiagnostic.ts index 065b20cb0..176dfa20c 100644 --- a/src/utils/doctorDiagnostic.ts +++ b/src/utils/doctorDiagnostic.ts @@ -113,17 +113,25 @@ export async function getCurrentInstallationType(): Promise { return 'npm-local' } - // Check if we're in a typical npm global location + // Check if we're in a typical npm global location (Unix + Windows) const npmGlobalPaths = [ '/usr/local/lib/node_modules', '/usr/lib/node_modules', '/opt/homebrew/lib/node_modules', '/opt/homebrew/bin', '/usr/local/bin', - '/.nvm/versions/node/', // nvm installations + '/.nvm/versions/node/', // nvm installations (Unix) + '\\nvm', // nvm4w installations (Windows, e.g. C:\nvm4w\nodejs) ] - if (npmGlobalPaths.some(path => invokedPath.includes(path))) { + // Normalize path separators for cross-platform matching + const normalizedPath = invokedPath.replace(/\\/g, '/') + if ( + npmGlobalPaths.some(path => invokedPath.includes(path)) || + normalizedPath.includes('/nvm') || + normalizedPath.includes('/nodejs/') || + normalizedPath.includes('/.nvm/') + ) { return 'npm-global' }