refactor: 移除多余依赖,统一 MUI 为唯一 UI 库

- 移除 radix-ui、clsx、tailwind-merge、class-variance-authority、react-router-dom

- 前后端全面适配 MUI 组件,清理残留 Tailwind 工具类引用

- 优化 Agent Loop 引擎、IPC 处理器、Provider Adapter 等后端模块

- 新增 Agent 网络工具通用设计文档 v2
This commit is contained in:
thzxx
2026-07-05 19:15:48 +08:00
parent ba85328c4f
commit f4532a2bb2
50 changed files with 1474 additions and 2042 deletions
+7 -7
View File
@@ -36,7 +36,7 @@ export class HealthChecker {
async check(): Promise<HealthReport> {
const checks: HealthCheck[] = [];
checks.push(await this.checkDatabase());
checks.push(await this.checkDiskSpace());
checks.push(await this.checkFreeMemory());
checks.push(await this.checkMemoryUsage());
const allHealthy = checks.every((c) => c.healthy);
return { healthy: allHealthy, checks, timestamp: new Date() };
@@ -66,28 +66,28 @@ export class HealthChecker {
}
}
private async checkDiskSpace(): Promise<HealthCheck> {
private async checkFreeMemory(): Promise<HealthCheck> {
try {
const userDataPath = app.getPath('userData');
if (!existsSync(userDataPath)) {
return { name: 'disk_space', healthy: false, error: 'User data path not accessible' };
return { name: 'free_memory', healthy: false, error: 'User data path not accessible' };
}
// 检查实际可用磁盘空间Windows/Linux 返回字节数)
// 检查实际可用内存Windows/Linux 返回字节数)
const { freemem } = await import('os');
const freeBytes = freemem();
const freeMB = freeBytes / (1024 * 1024);
// 少于 200MB 视为不健康
if (freeMB < 200) {
return {
name: 'disk_space',
name: 'free_memory',
healthy: false,
error: `Free memory critically low: ${freeMB.toFixed(0)}MB available`,
};
}
return { name: 'disk_space', healthy: true };
return { name: 'free_memory', healthy: true };
} catch (error) {
return {
name: 'disk_space',
name: 'free_memory',
healthy: false,
error: error instanceof Error ? error.message : String(error),
};