feat: 新增agent

This commit is contained in:
2026-09-18 17:34:38 +08:00
parent 0d9b5a21c2
commit bc73668737
64 changed files with 3293 additions and 18 deletions
+10
View File
@@ -8,6 +8,7 @@
apps/
web/ # 前端(原 ecom-dmb-frontend,pnpm+turbo,应用 apps/web-antd)
server/ # 主后端(原 ecom-dmb-backend,Spring Boot)
agent/ # 智能助手(FastAPI/LangGraph;会话 Mongo;模型 Key 落 Server MySQL)
license-server/ # 授权(原 ecom-license:server/ + tui/)
browser-extension/ # 浏览器扩展
order-generator/ # 刷单/删单测试工具
@@ -32,6 +33,15 @@ deploy/ # 部署 TUI(原 ecom-deploy),流程见 deploy/MANU
- lefthook 钩子会对暂存文件自动 prettier/eslint/stylelint `--fix`,commitlint 强制 conventional commit,不要绕过
- 代码内 `#/` 别名 = `src/`
- **web-antd 视图里不要用 `<Spin :spinning>` 整块包住可滚动列表**(ant-spin-container 破坏滚动链);滚动依赖 `flex-1 min-h-0 overflow-y-auto`,加载态拆细(详见 `.cursor/rules/antd-spin-scrollable-layout.mdc`)
- 智能助手页:`views/agent/chat`;开发代理 `/api/agent` → `localhost:8200`(见 `vite.config.mts`)
## Agent(apps/agent)
- Python 3.11+;设计 `apps/agent/DESIGN.md`
- `cd apps/agent && python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt`
- 配置 `.env`(参考 `.env.example`):`JWT_SECRET` 须与 Java `jwt.secret` 一致
- 运行:`uvicorn app.main:app --reload --port 8200`
- 租户自管 OpenAI Compatible 凭证(Mongo 加密 + Redis 缓存);聊天/会话在 Agent Mongo 库
## 授权(apps/license-server)