mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-31 11:01:36 +08:00
feat(settings): diagnose conflicting tool installations with uninstall hints
Add a "Diagnose installs" action to the About section that enumerates every installation of each managed CLI, flags real conflicts (diverging versions or mixed runnable state), and lists them under the affected tool card. - backend: enumerate_tool_installations + diagnose_tool_installations command, sharing build_tool_search_paths with the single-probe scan; resolve the PATH default via the same login shell as version probing so the "Default" marker matches what the command line (and an upgrade) actually targets - frontend: global diagnose button left of Refresh, per-card conflict list, and a copy-only uninstall command per install -- source-aware (npm/volta/ bun/pip) and anchored to that install's own npm to avoid removing the wrong node version; marked with a red trash icon, never executed - auto-diagnose silently after an upgrade that leaves the version unchanged or installs something that can't run - i18n: zh/en/ja
This commit is contained in:
@@ -208,6 +208,10 @@ export const settingsApi = {
|
||||
});
|
||||
},
|
||||
|
||||
async diagnoseToolInstallations(tool: string): Promise<ToolInstallation[]> {
|
||||
return await invoke("diagnose_tool_installations", { tool });
|
||||
},
|
||||
|
||||
async getRectifierConfig(): Promise<RectifierConfig> {
|
||||
return await invoke("get_rectifier_config");
|
||||
},
|
||||
@@ -233,6 +237,16 @@ export const settingsApi = {
|
||||
},
|
||||
};
|
||||
|
||||
/** 单处工具安装的诊断信息(多处安装冲突检测)。字段对应后端 ToolInstallation。 */
|
||||
export interface ToolInstallation {
|
||||
path: string;
|
||||
version: string | null;
|
||||
runnable: boolean;
|
||||
error: string | null;
|
||||
source: string;
|
||||
is_path_default: boolean;
|
||||
}
|
||||
|
||||
export interface RectifierConfig {
|
||||
enabled: boolean;
|
||||
requestThinkingSignature: boolean;
|
||||
|
||||
Reference in New Issue
Block a user