9c9a51263c
汇总未提交工作区:Servers 列表 site_url 链接、终端页与选机器 UI、SSH 连通性与 Telegram 通知、agent/offline/unset_path 后台调度与 gate_ai_review 门控;更新 AGENTS 与 agent-exploration 规则(仅本机 commit);同步 web/app 构建产物与相关文档。
3.6 KiB
3.6 KiB
Nexus 6.0 — Agent 入口(薄 stub)
长文 SSOT: docs/project/nexus-functional-development-guide.md + 附录
会话接续: docs/project/AI-HANDOFF-2026-06-03.md
文档总索引: docs/README.md
项目概要
Nexus:2000+ 子机运维平台。后端 FastAPI + MySQL + Redis;前端 Vue 3 + Vuetify 4 + TypeScript SPA(15 页,frontend/src/pages/);构建输出 web/app/;安装向导 web/app/install.html。
本地开发
docker compose up -d mysql redis
bash scripts/start-dev.sh # API :8600
bash scripts/local_verify.sh # L2b
cd frontend && npm run dev # :3000/app/
路径见 linux-dev-paths.md。
Git(仅本机快照)
- 本地
git commit用于回滚;不git push(除非你明确要求)。 - 已移除
origin跟踪,避免误推;原远程:http://66.154.115.8:3000/admin/Nexus.git(需恢复时说一声)。 .env、SECRETS.md、*.pem已在.gitignore,勿提交。- 改代码仍写
docs/changelog/YYYY-MM-DD-*.md(≥10 行)。 - 用户说「提交快照 / commit」时执行。
强制约束
- 完美实现:
.cursor/rules/perfect-implementation.mdc - 安全 / 后端 / 前端:
.cursor/rules/nexus-*.mdc - 改代码必
docs/changelog/YYYY-MM-DD-*.md(≥10 行) - 测试由 Agent 完成;用户只做终验
不可改
API_KEY · SECRET_KEY · ENCRYPTION_KEY · DATABASE_URL
部署
bash deploy/pre_deploy_check.sh
bash deploy/deploy-production.sh # 需 SSH nexus + 用户批准
详情见功能指南 §17–18。
归档文档
历史审计合并卷:docs/archive/README.md
代码地图(Agent 先读这里,勿全库搜)
server/main.py # 路由挂载入口
server/config.py # 配置(.env + settings 表)
server/api/*.py # HTTP/WebSocket 路由(按模块拆分)
server/application/ # 业务 services
server/infrastructure/ # DB / Redis / SSH / Telegram
server/domain/models/ # SQLAlchemy ORM
frontend/src/pages/ # Vue 页面(15 页 SPA)
frontend/src/router/ # Hash 路由 #/
frontend/src/api/ # 前端 API 客户端
frontend/e2e/ # Playwright 验收
tests/test_*.py # pytest
docs/project/ # 功能/部署 SSOT
deploy/ # 生产部署脚本
scripts/ # 本地验证、MCP、门控
.cursor/mcp.json # mysql-mcp
问题 → 文件(常见锚点)
| 问什么 | 先看 |
|---|---|
| 某 API 怎么实现 | server/main.py 找 router → server/api/<模块>.py |
| 服务器列表/搜索/exec | server/api/servers.py, server/api/scripts.py |
| 认证/JWT | server/api/auth.py, server/api/dependencies.py |
| Agent 心跳/安装 | server/api/agent.py |
| WebSSH/终端 | server/api/webssh.py, server/api/terminal.py |
| 同步/文件/搜索 | server/api/sync_v2.py, files.py, search.py |
| 设置/审计/告警 | server/api/settings.py |
| 前端某页 UI | frontend/src/router/index.ts → frontend/src/pages/ |
| MySQL MCP | .cursor/mcp.json, scripts/linux_mcp_mysql.sh |
| 本地开发路径 | docs/project/linux-dev-paths.md |
| 14 页/API 全览 | docs/project/nexus-functional-development-guide.md §9–10 |
探索规则(省 token)
详见 .cursor/rules/agent-exploration.mdc。要点:先地图再 Grep(带 path)→ Read ≤5 个文件 → 停止。