feat(center): 新增通知实时推送 WS /ws/notifications,管理台建单秒达

挂到 Koa 同一 http.Server 的 upgrade 事件(复用 8800,不占新端口、不改 nginx),X-API-Token 握手鉴权,帧格式对齐执行机 notifier.js;新建通知后立即广播(target=all / account),GET /api/notifications 轮询继续兜底。

连接状态放模块作用域(生命周期挂载与请求内推送的 provider 实例不保证同一个),心跳 30s 清理半开连接;src/index.ts 补导出(bundle 关闭 moduleDetector 时必须显式导出)。

部署 SOP 增加 WS 端点探针,客户端交接文档补 /ws/notifications 契约。
This commit is contained in:
2026-11-10 16:38:00 +08:00
parent 41ffbf30d3
commit 066bbe4989
6 changed files with 296 additions and 2 deletions
@@ -143,6 +143,11 @@ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8800/api/shell/version
curl -s http://127.0.0.1:8090/ | head -c 200
# 文件服务器
curl -s http://127.0.0.1:8802/
# 通知 WS 端点已挂载(未带票据应为 401;返回 404 说明该版本后端还没有 /ws/notifications)
curl -s -o /dev/null -w '%{http_code}\n' \
-H 'Connection: Upgrade' -H 'Upgrade: websocket' -H 'Sec-WebSocket-Version: 13' \
-H 'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==' \
'http://127.0.0.1:8800/ws/notifications?account=test'
```
本机发版 CLI 预检: