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
xuhd and Claude Sonnet 4.6
40cd8a24af
feat: admin skill public upload + user management page
...
- Admin users can choose to install skills to public (built-in) or custom category via UI radio selector in InstallSkillDialog
- Backend: SkillStorage.ainstall_skill_from_archive accepts target_category param; non-admin 403 on public install
- Backend: AgentStore/SkillStore add count_owned(user_id); UserRepository/LocalAuthProvider add list_users()
- Backend: GET /api/v1/auth/users endpoint (admin-only) returns all users with skill_count and agent_count
- Frontend: admin-only "用户管理" nav item in sidebar; /page/workspace/admin/users route with user table
- i18n: added sidebar.users and adminUsers section in zh-CN/en-US
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-14 20:40:23 +08:00
吉鑫升
3ea33e1dee
大模型速度增加提示
2026-05-14 19:12:14 +08:00
xuhd and Claude Opus 4.7
4ef96c7930
feat(skills): 多租户阶段 3 — Curator + 配置 per-user
...
curator_log.py
- ring buffer 从单一 deque 改为 dict[user_id -> deque],每个用户
自己的运行日志互不可见
- start_new_run / record / get_recent / clear 全部接 user_id
关键字参数;未传时落入 __default__ 桶兼容旧调用
- 新增 clear_all() 用于跨用户清理(仅测试用)
curator.py
- 状态文件路径从 skills/.curator_state 改为
.deer-flow/users/{user_id}/.curator_state(per-user 隔离)
- 所有公开 API 接受 user_id 参数:should_run_now /
apply_automatic_transitions / _render_candidate_list /
run_curator_review / _curator_thread_target /
get_curator_status / _make_skill_archive_tool / _run_llm_review
- 新增 _list_user_owned_skill_names(user_id):通过 SkillStore
查询当前用户拥有的 skill 名集合,用于过滤 transitions / LLM
candidates,保证 user A 跑 curator 不会动 user B 的 skill;
SkillStore 不可达时退化为"全部 agent-created skill"(兼容旧部署)
- _get_curator_config(user_id) 通过 load_skill_evolution_config_for_user
叠加 per-user override,让阈值/间隔/moderation_model 也是 per-user
- maybe_run_curator 启动时枚举 UserRow,按用户检查 should_run_now
并各起一个 daemon 线程跑
skill_evolution_runtime.py
- 全局 backend/skill_evolution.json 语义保留作为 fallback
- 新增 per-user API:resolve_user_path / load_user_overrides /
save_user_overrides / get_user_overrides_mtime,文件落到
.deer-flow/users/{user_id}/skill_evolution.json
- 新增 load_skill_evolution_config_for_user(user_id):读全局
SkillEvolutionConfig 作为 baseline,浅合并 per-user JSON,
返回 Pydantic 实例。验证失败时回落到 baseline
routers/skills.py
- /api/curator/status / run / config GET+PUT / logs 全部接
_current_user_id 注入运行上下文
- update_curator_config 改为 per-user:保存到
users/{user_id}/skill_evolution.json,不再 reset_app_config
- _build_curator_config_response 接受 SkillEvolutionConfig 实例
(而不是 AppConfig)以适配 per-user 合并结果
旧 19 个测试继续通过;未引入新依赖。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 17:09:05 +08:00
xuhd and Claude 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
xuhd and Claude Opus 4.7
f5bc02d598
fix: skills 路由两个小修复
...
skills.py:
- update_curator_config 直接 await get_curator_config() 报错
('Depends' object has no attribute 'skill_evolution')。FastAPI 路由
默认参数 Depends(...) 只在请求时被框架解析,直接调用拿到的是依赖标记。
抽出 _build_curator_config_response(config) 让 GET 和 PUT 共用。
skill_manage_tool.py:
- 模型把 action='list' 当成可用动作误调 skill_manage 报
Unsupported action。补两个 read-only 别名 list/view,分别委派到
skill_list_tool 和 skill_view_tool,docstring 同步更新。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 15:43:26 +08:00
xuhd and Claude Opus 4.7
9b6b94d919
feat(skills): 自我进化后端 — curator 配置可编辑 + 运行日志可读
...
后端骨架:
- curator.py / usage.py / skill_tools.py:基于使用计数的生命周期管理
+ LLM 合并/归档建议(同事已有原型,集中提交)
- skill_evolution_config.py:CuratorConfig 嵌套模型
- app.py:启动时按间隔触发 curator 后台线程
- tools.py:开启自我进化时一并注册 skill_list / skill_view 工具
- skill_manage_tool.py:agent 创建技能时标记 source=agent
本次新增:
- skill_evolution_runtime.py:skill_evolution.json 读写,原子写入
- app_config.py:把 overrides 深合并到 AppConfig.skill_evolution,
并把 overrides 的 mtime 纳入缓存失效条件,前端 PUT 后热生效
- curator_log.py:进程内 ring buffer (maxlen=200),所有 record/get
操作内部兜异常,保证 logging 永远不会让 curator 跑挂
- curator.py 关键节点插桩:run_started / 自动转换计数 / 候选数 /
LLM agent invoke / 解析结果 / archive 动作 / run complete
- routers/skills.py:GET/PUT /api/curator/config(写到
skill_evolution.json + reset_app_config)+ GET /api/curator/logs
测试:
- tests/test_skill_evolution_runtime.py:overrides 往返、损坏 JSON
容错、AppConfig 合并、ring buffer 线程安全、record 异常吞咽
杂项:
- .gitignore:忽略 .deer-flow/* 与 skills/* 等运行时目录
- uv.lock:跟随依赖锁更新
- 清理已废弃的 agent runtime 数据 SOUL.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 12:00:21 +08:00
fengxiangdebaozi
2f2ba44c7c
添加推荐问题修改接口
2026-05-14 11:07:28 +08:00
xuhd and Claude Opus 4.7
434cf40b36
fix: /login/admin 自动把历史 admin 账户升级为 admin 角色
...
历史上以 username=admin 自动注册的账户曾被建成 system_role=user,
登录时按 username 修正一次,避免老库需要手工改表。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 10:25:24 +08:00
xuhd and Claude Opus 4.7
43044232bb
feat: admin可删除内置专家
...
复用 _get_editable_or_raise 分支,给 AgentStore 增加 delete_builtin,
路由按 edit_mode 决定走 delete 还是 delete_builtin;前端 agent-card
为 admin 显示内置 agent 的删除按钮。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 09:53:13 +08:00
xuhd and Claude Sonnet 4.6
2abdf28eba
feat: admin可编辑内置专家 + agent列表Tab分组
...
- /login/admin 登录时自动赋予 admin 角色,允许编辑内置专家
- agent列表页新增「全部」(内置+已发布) 和「自己的」两个Tab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-13 23:16:18 +08:00
吉鑫升
31abad86d5
智能体配置
2026-05-13 20:04:06 +08:00
吉鑫升
a27206c543
Update local frontend and backend changes
2026-05-13 17:17:42 +08:00
吉鑫升
faca2c9a2d
Merge branch 'likun' into master
2026-05-13 17:02:22 +08:00
吉鑫升
aa034f8669
定时任务订阅模式
2026-05-13 14:59:27 +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