xuhd
|
9a67ca7c03
|
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into xuhd
|
2026-05-14 20:45:02 +08:00 |
|
吉鑫升
|
3ea33e1dee
|
大模型速度增加提示
|
2026-05-14 19:12:14 +08:00 |
|
 xuhdandClaude Opus 4.7
|
cf191ef874
|
feat(skills/notifications): 多租户阶段 2 — 路由 + 级联 + 启动迁移
后端工作:
deps.py
- 挂载 skill_store / notification_store 到 app.state
- 启动时 set_notification_store(...) 注入到 harness sender;
关闭时清空,保证测试和 embedded 模式不留状态
- 加 get_skill_store / get_notification_store FastAPI 依赖
routers/skills.py
- 加 _current_user_id / _is_admin_user / _get_owned_skill_or_raise /
_get_editable_skill_or_raise(对齐 routers/agents.py)
- SkillResponse 加 owner_user_id / published / builtin 字段,
_skill_to_response 接受 SkillStore 记录映射
- GET /api/skills 与 GET /api/skills/custom 改 per-user 可见性过滤
- POST /api/skills/install + /install-upload 预解析 archive 名校验
全局 name 不被他人持有;安装后 ensure_legacy 注册 owner=current
- DELETE /api/skills/custom/{name} 走 _get_editable_skill_or_raise,
调 cascade(owner 自删 = delete,admin 跨用户 = admin_takedown),
SkillStore.delete / delete_admin 同步清除 DB 记录
- 新增 PUT /api/skills/custom/{name}/published 切换发布状态;
从 published → unpublished 时触发 cascade(unpublish / admin_takedown)
skills/cascade.py(新)
- 扫所有 .deer-flow/agents/{id}/config.yaml,把指定 skill 从其 skills
数组移除,并通过 deerflow.persistence.notifications.notify 给受
影响 agent 的 owner 发站内信;admin 强制下架时另给 skill owner 发
一条
- 操作类型:unpublish / delete / admin_takedown,对应不同文案
routers/notifications.py(新)+ app.include_router
- GET /api/notifications(unread_only / limit)
- GET /api/notifications/unread_count(红点用)
- POST /api/notifications/{id}/read
- POST /api/notifications/read_all
- DELETE /api/notifications/{id}
app.py lifespan
- _sync_legacy_skills(app):每次启动扫 skills/custom/ 把没在 DB
的 skill 落库为 admin owner + published=True,幂等、非阻塞失败
- 调用顺序:_ensure_admin_user → _sync_legacy_skills → 启动 curator
测试:19 个旧用例继续通过;阶段 4 会写 test_skills_multitenancy.py
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-14 16:24:42 +08:00 |
|
fengxiangdebaozi
|
2f2ba44c7c
|
添加推荐问题修改接口
|
2026-05-14 11:07:28 +08:00 |
|
likun
|
b8926f00d7
|
新增用户意图确认功能
|
2026-05-13 14:36:44 +08:00 |
|
吉鑫升
|
cf2e4bdd9c
|
智能体分权
|
2026-05-13 11:36:17 +08:00 |
|
吉鑫升
|
e7a455f22e
|
Initial commit: deerflow-server (frontend-web + offline-backend-20260512)
|
2026-05-13 09:36:15 +08:00 |
|