From 81970a1d059cca31db33d7f6f477f40ed24203e9 Mon Sep 17 00:00:00 2001 From: rayd1o Date: Sun, 17 May 2026 02:50:42 +0800 Subject: [PATCH] release: bump version to 0.60.0 --- README.md | 203 ++--- TODO.md | 7 + VERSION | 2 +- backend/app/ai_tasks/default_prompts.json | 8 +- backend/app/api/v1/collected_data.py | 12 +- backend/app/api/v1/datasources.py | 3 +- backend/app/api/v1/earth.py | 133 ++- backend/app/main.py | 10 + backend/app/services/bgp_ai_brief.py | 1 + backend/app/services/earth_news.py | 7 +- .../services/situational_alert_ai_brief.py | 18 +- backend/tests/test_api.py | 144 +++ .../tests/test_situational_alert_ai_brief.py | 71 ++ docs/CHANGELOG.md | 17 + .../agents-earth-command-runtime-plan.md | 810 +++++++++++++++++ docs/technical/en/agents-aiprovider.md | 6 + docs/technical/en/earth-frontend-context.md | 6 + docs/technical/en/faq.md | 6 + docs/technical/en/manual.md | 5 +- docs/technical/zh/agents-aiprovider.md | 6 + docs/technical/zh/earth-frontend-context.md | 6 + docs/technical/zh/faq.md | 6 + docs/technical/zh/manual.md | 5 +- docs/version-history.md | 3 +- frontend/package.json | 2 +- frontend/public/earth/css/hud.css | 243 +++++ frontend/public/earth/css/info-panel.css | 10 + frontend/public/earth/index.html | 367 +++++--- frontend/public/earth/js/brand.js | 89 +- frontend/public/earth/js/controls.js | 852 ++++++++++++++++-- frontend/public/earth/js/main.js | 9 +- frontend/public/earth/js/news.js | 9 +- .../src/components/AppLayout/AppLayout.tsx | 38 +- frontend/src/index.css | 164 ++++ frontend/src/pages/AISettings/AISettings.tsx | 66 +- frontend/src/pages/Alerts/BGPAlerts.tsx | 3 +- .../src/pages/Alerts/SituationalAlerts.tsx | 17 +- frontend/src/pages/DataList/DataList.tsx | 49 +- .../src/pages/DataSources/DataSources.tsx | 38 +- frontend/src/pages/Settings/Settings.tsx | 379 +++++++- frontend/src/pages/Settings/SmtpPanel.tsx | 7 +- pyproject.toml | 2 +- uv.lock | 2 +- 43 files changed, 3378 insertions(+), 463 deletions(-) create mode 100644 backend/tests/test_situational_alert_ai_brief.py create mode 100644 docs/plans/agents-earth-command-runtime-plan.md diff --git a/README.md b/README.md index c069cb99..001c18e1 100644 --- a/README.md +++ b/README.md @@ -8,68 +8,54 @@ ## 系统架构 +当前仓库的核心形态是“Web Earth 可视化 + React 运维台 + FastAPI 数据与 AI 编排后端 + 独立模型适配层”。物理大屏与 UE 客户端仍是长期方向,但不再作为本地开发和当前发布的必需运行单元。 + ``` -┌─────────────────────────────────────────────────────────────────────────┐ -│ 物理大屏展示层 │ -│ ┌─────────────────────────────────────────────────────────────────┐ │ -│ │ 偏振片3D大屏 (2m×3m, 4K, 120Hz, 眼镜式) │ │ -│ │ ┌─────────────────────────────────────────────────────────┐ │ │ -│ │ │ 虚幻引擎 UE5 客户端 │ │ │ -│ │ │ ├── 3D地球渲染 (Cesium for UE) │ │ │ -│ │ │ ├── 算力点可视化 (GPU集群、智算中心) │ │ │ -│ │ │ ├── 连接弧线 (光缆、路由、数据流向) │ │ │ -│ │ │ ├── 粒子效果 (数据流动、告警提示) │ │ │ -│ │ │ └── 自动巡航相机 + 交互控制 │ │ │ -│ │ └─────────────────────────────────────────────────────────┘ │ │ -│ └─────────────────────────────────────────────────────────────────┘ │ -└─────────────────────────────────────────────────────────────────────────┘ - ▲ - │ WebSocket (实时推送) - │ 120Hz 心跳 / 数据帧同步 - ▼ -┌─────────────────────────────────────────────────────────────────────────┐ -│ 数据中台服务层 (FastAPI) │ -│ ┌─────────────────────────────────────────────────────────────────┐ │ -│ │ API Gateway (Redis 限流) │ │ -│ └─────────────────────────────────────────────────────────────────┘ │ -│ │ │ -│ ┌───────────────────┬──────────────────────────┬──────────────────┐ │ -│ │ 数据采集服务 │ 核心业务服务 │ 运维管理服务 │ │ -│ │ ┌─────────────┐ │ ┌─────────────────┐ │ ┌─────────────┐ │ │ -│ │ │ 调度中心 │ │ │ WebSocket 服务 │ │ │ 用户管理 │ │ │ -│ │ │ (Celery) │ │ │ (FastAPI) │ │ │ (JWT Auth) │ │ │ -│ │ └─────────────┘ │ └─────────────────┘ │ └─────────────┘ │ │ -│ │ ┌─────────────┐ │ ┌─────────────────┐ │ ┌─────────────┐ │ │ -│ │ │ 采集器池 │ │ │ 数据查询 API │ │ │ 数据源配置 │ │ │ -│ │ │ (10+源) │ │ │ (REST) │ │ │ 监控告警 │ │ │ -│ │ └─────────────┘ │ └─────────────────┘ │ └─────────────┘ │ │ -│ │ ┌─────────────┐ │ ┌─────────────────┐ │ ┌─────────────┐ │ │ -│ │ │ 消息队列 │ │ │ 态势分析引擎 │ │ │ 系统配置 │ │ │ -│ │ │ (Kafka) │ │ │ (计算/聚合) │ │ │ 日志审计 │ │ │ -│ │ └─────────────┘ │ └─────────────────┘ │ └─────────────┘ │ │ -│ └───────────────────┴──────────────────────────┴──────────────────┘ │ -└─────────────────────────────────────────────────────────────────────────┘ - ▲ - │ 内部 API 调用 - ▼ -┌─────────────────────────────────────────────────────────────────────────┐ -│ Web管理端 (React Admin) │ -│ ┌─────────────────────────────────────────────────────────────────┐ │ -│ │ 登录页 │ 仪表盘 │ 用户管理 │ 数据源配置 │ 任务监控 │ 系统配置 │ │ -│ └─────────────────────────────────────────────────────────────────┘ │ -└─────────────────────────────────────────────────────────────────────────┘ - ▲ - │ PostgreSQL / Redis - ▼ -┌─────────────────────────────────────────────────────────────────────────┐ -│ 数据存储层 │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ -│ │ PostgreSQL │ │ TimescaleDB │ │ Redis │ │ MinIO │ │ -│ │ (用户/配置) │ │ (时序数据) │ │ (缓存/会话) │ │ (文件存储) │ │ -│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │ -└─────────────────────────────────────────────────────────────────────────┘ +┌─────────────────────────────────────────────────────────────────────┐ +│ 浏览器展示与运维层 │ +│ ┌──────────────────────────────┐ ┌──────────────────────────────┐ │ +│ │ Web Earth │ │ React 运维台 │ │ +│ │ frontend/public/earth │ │ frontend/src │ │ +│ │ Three.js 地球 / HUD / 新闻 │ │ 数据源 / 告警 / AI 设置 │ │ +│ │ 国界精度 / 品牌内容配置 │ │ 提示词配置 / 用户与系统配置 │ │ +│ └──────────────────────────────┘ └──────────────────────────────┘ │ +└─────────────────────────────────────────────────────────────────────┘ + │ REST / WebSocket + ▼ +┌─────────────────────────────────────────────────────────────────────┐ +│ FastAPI 业务与编排后端 │ +│ ┌────────────────────┐ ┌────────────────────┐ ┌─────────────────┐ │ +│ │ 数据 API 与认证 │ │ Earth 新闻增强 │ │ 告警与态势简报 │ │ +│ │ JWT / 权限 / 审计 │ │ 位置推断 / 本地化 │ │ BGP / 告警研判 │ │ +│ └────────────────────┘ └────────────────────┘ └─────────────────┘ │ +│ ┌────────────────────┐ ┌────────────────────┐ ┌─────────────────┐ │ +│ │ 系统运行配置 │ │ 默认提示词注册表 │ │ 未来 Agent Runtime│ │ +│ │ system_settings │ │ 代码发布 + DB 覆盖 │ │ 工具/证据/工作流 │ │ +│ └────────────────────┘ └────────────────────┘ └─────────────────┘ │ +└─────────────────────────────────────────────────────────────────────┘ + │ SQLAlchemy / Redis Stream │ 纯净 LLM 调用 + ▼ ▼ +┌──────────────────────────────┐ ┌──────────────────────────────┐ +│ PostgreSQL / Redis │ │ aiprovider │ +│ 用户、配置、采集结果、新闻 │ │ provider + protocol adapter │ +│ Stream、缓存、运行状态 │ │ OpenAI / MiniMax / Ollama 等 │ +└──────────────────────────────┘ └──────────────────────────────┘ + ▲ + │ 采集器 / 外部数据源 + ▼ +┌─────────────────────────────────────────────────────────────────────┐ +│ RSS 新闻、BGP 观测、公开数据源、后续 WebSearch/OCR/语音识别等工具 │ +└─────────────────────────────────────────────────────────────────────┘ ``` +架构边界: + +- `backend` 负责业务语义、证据收集、提示词选择、AI 任务编排、权限和数据落库。 +- `aiprovider` 只负责把纯净模型请求适配到不同供应商或协议,不内置具体业务提示词。 +- 默认提示词随代码发布并保存在 `backend/app/ai_tasks/default_prompts.json`,运维台可在数据库中保存覆盖值,重置时回到当前代码版本的默认提示词。 +- Earth 新闻保留英文原文,中文展示结果存入 `localizations`,前端默认展示 `zh-CN` 的 `display_title`、`display_summary` 和中文地域/状态文案。 +- Earth LLM 指令、语音识别、多角色态势研判属于后续 Agent Runtime 方向,计划见 [docs/plans/agents-earth-command-runtime-plan.md](/home/ray/dev/linkong/planet/docs/plans/agents-earth-command-runtime-plan.md)。 + ## 四大核心要素 | 层级 | 要素 | 描述 | @@ -87,11 +73,10 @@ |------|------|------| | FastAPI | 0.109+ | Web 框架 | | SQLAlchemy | 2.0+ | ORM | -| Alembic | - | 数据库迁移 | -| Celery | 5.3+ | 任务队列 | -| Redis | 7.0+ | 缓存/消息 | -| Kafka | 3.0+ | 事件流 | +| uv | - | Python 依赖与命令运行 | +| Redis | 7.0+ | 缓存、Stream 与运行协调 | | PyJWT | - | 认证 | +| APScheduler / 后台任务 | - | 采集、增强与运行时任务 | ### 前端 (React Admin) @@ -102,6 +87,7 @@ | Axios | HTTP 客户端 | | Socket.io-client | WebSocket 客户端 | | ECharts | 统计图表 | +| Three.js | Earth 3D 地球渲染 | | Bun | 前端包管理与脚本运行 | 前端工程统一使用 Bun: @@ -110,22 +96,16 @@ - 运行脚本使用 `bun run