fix: DevTools Windows兼容性修复 + 日志UI重构 (7服务并排显示)

- process-manager: 移除ESM中的require(), 跨平台spawn(.exe/.cmd), path.dirname修复
- config: 自动检测Go二进制路径, Windows构建产物使用.exe后缀
- index: 移除SSH隧道代码, 改用Docker容器检查数据库状态
- index.html: 日志默认并排网格布局, 7个服务横向滚动, 数据库面板改用Docker控制
- docs: 更新Migration.md启动顺序(7服务+DevTools自动编译), README添加Windows用法

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 21:05:07 +08:00
parent 697ed72db4
commit e4d2eab9ad
6 changed files with 228 additions and 203 deletions
+49 -19
View File
@@ -244,17 +244,46 @@ docker-compose -f docker-compose.dev.db.yml up -d
### 6.5 启动顺序
服务启动顺序很重要,请按以下顺序启动
**推荐使用 DevTools 一键启动**(自动编译 + 按序启动 + 健康检查)
| 顺序 | 服务 | 默认端口 | 命令 |
|------|------|---------|------|
| 1 | memory-service | — | `cd backend\memory-service && .\main.exe` |
| 2 | iot-debug-service | 8083 | `cd backend\iot-debug-service && .\main.exe` |
| 3 | tool-engine | — | `cd backend\tool-engine && .\main.exe` |
| 4 | ai-core | 8081 | `cd backend\ai-core && .\main.exe` |
| 5 | gateway | 8080 | `cd backend\gateway && .\main.exe` |
```cmd
cd devtools
node src\index.js
:: 浏览器打开 http://localhost:9090,点击「一键启动」
```
> 每个服务需要在独立的终端窗口中启动。
或使用启动脚本:
```cmd
devtools.bat
```
DevTools 会按以下顺序自动编译并启动所有 7 个服务:
| 顺序 | 服务 | 端口 | 说明 |
|------|------|------|------|
| 1 | memory-service | 8091 | 记忆 CRUD 与检索 |
| 2 | tool-engine | 8092 | 工具执行引擎 |
| 3 | iot-debug-service | 8083 | 模拟智能家居设备 |
| 4 | voice-service | 8093 | TTS/STT 语音服务 |
| 5 | ai-core | 8081 | LLM 推理与编排 |
| 6 | gateway | 8080 | API 网关 / JWT / WebSocket |
| 7 | frontend | 5173 | React 开发服务器 |
> 每个步骤会自动等待健康检查通过后再启动下一个服务。如果 Go 二进制未编译,DevTools 会自动先编译再启动。
如需手动逐个启动:
```powershell
# 按顺序执行,每个在独立终端中运行
cd backend\memory-service && go build -o main.exe .\cmd\main.go && .\main.exe
cd backend\tool-engine && go build -o main.exe .\cmd\main.go && .\main.exe
cd backend\iot-debug-service && go build -o main.exe .\cmd\main.go && .\main.exe
cd backend\voice-service && go build -o main.exe .\cmd\main.go && .\main.exe
cd backend\ai-core && go build -o main.exe .\cmd\main.go && .\main.exe
cd backend\gateway && go build -o main.exe .\cmd\main.go && .\main.exe
cd frontend\web && npm install && npm run dev
```
---
@@ -364,16 +393,17 @@ find backend -name "*.go" -exec dos2unix {} \;
| 2 | ✅ 前端构建成功 | `cd frontend\web && npm run build` 无报错 |
| 3 | ✅ 数据库连接正常 | 使用 `psql` 或数据库客户端连接 PostgreSQL |
| 4 | ✅ pgvector 扩展已安装 | `SELECT * FROM pg_extension WHERE extname='vector';` 返回一行 |
| 5 | ✅ memory-service 启动成功 | 无 panic 日志,监听预期端口 |
| 6 | ✅ iot-debug-service 启动成功 | 访问 `http://localhost:8083/health` 返回 200 |
| 7 | ✅ tool-engine 启动成功 | 无 panic 日志 |
| 8 | ✅ ai-core 启动成功 | 访问 `http://localhost:8081/health` 返回 200 |
| 9 | ✅ gateway 启动成功 | 访问 `http://localhost:8080/health` 返回 200 |
| 10 | ✅ 前端开发服务器启动 | 访问 `http://localhost:5173` 显示登录页面 |
| 11 | ✅ WebSocket 连接正常 | 登录后聊天功能正常,能收到 AI 回复 |
| 12 | ✅ IoT 设备控制正常 | 发送 IoT 控制指令,设备响应正确 |
| 13 | ✅ 语音合成 (TTS) 正常 | AI 回复能正常播放语音 |
| 14 | ✅ 语音识别 (ASR) 正常 | 语音输入能被正确识别 |
| 5 | ✅ memory-service 启动成功 | 无 panic 日志,监听 8091 端口 |
| 6 | ✅ tool-engine 启动成功 | 无 panic 日志,监听 8092 端口 |
| 7 | ✅ iot-debug-service 启动成功 | 访问 `http://localhost:8083/api/v1/health` 返回 200 |
| 8 | ✅ voice-service 启动成功 | 访问 `http://localhost:8093/api/v1/health` 返回 200 |
| 9 | ✅ ai-core 启动成功 | 访问 `http://localhost:8081/api/v1/health` 返回 200 |
| 10 | ✅ gateway 启动成功 | 访问 `http://localhost:8080/api/v1/health` 返回 200 |
| 11 | ✅ 前端开发服务器启动 | 访问 `http://localhost:5173` 显示登录页面 |
| 12 | ✅ WebSocket 连接正常 | 登录后聊天功能正常,能收到 AI 回复 |
| 13 | ✅ IoT 设备控制正常 | 发送 IoT 控制指令,设备响应正确 |
| 14 | ✅ 语音合成 (TTS) 正常 | AI 回复能正常播放语音 |
| 15 | ✅ 语音识别 (ASR) 正常 | 语音输入能被正确识别 |
---