zcbot/web
caoqianming 25d8a6572f refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732
照 admin.py 的 register_*_routes 注册范式把 create_app 巨型闭包拆开,
依赖(require_user/auth_cfg)显式传参,对外 /v1 契约零变化:

- web/routers/:misc/models/authroutes/wechat(含企微)/kb/schedules/
  skills_memory/files/asr/tasks/messages 共 11 个模块
- web/common.py:跨 router 常量与 helper(task_dict/usage_aggregates/
  sse_event/assert_owns_task 等)
- web/schemas.py:13 个 Pydantic 请求模型独立成文件
- web/model_gate.py:模型档位门控 + image/video variant 解析
- web/runs.py:run_agent_bg + run_channel_conversation(BG worker 与
  渠道入站对话核心,从 app.py 模块级函数析出)
- web/userfiles.py:路径安全原语(safe_join 越界校验/transfer 预检)收口
- app.py 只剩 App 工厂 + lifespan 后台协程群

验证:286 测试全过;路由面 81 条逐条一致;TestClient 冒烟
(healthz 200/坏 platform_key 403/未鉴权 401/lifespan 正常启动)。
test_changelog/test_pptx_render 的 import 指向同步更新。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:18:57 +08:00
..
routers refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
static feat(kb): 个人知识库——.kb/ 纯文件机制+/v1/kb* API+前端 modal+注入契约(bump 0.59.0) 2026-07-22 15:20:43 +08:00
__init__.py core(§7 Phase G G1): Web UI 脚手架 + cli.py web 子命令 2026-05-14 13:37:54 +08:00
admin.py feat(ops): 工具失败聚集巡检,同签名报错自动冒头(bump 0.58.11) 2026-07-13 08:36:31 +08:00
app.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
auth.py feat(auth): JWT 滑动续签——活跃用户临期无感换 token,不再因 7d TTL 掉线(bump 0.58.39) 2026-07-18 10:21:35 +08:00
broker.py feat(broker): 外置 Redis pub/sub——蓝绿跨实例 SSE/cancel 可达(bump 0.42.0) 2026-07-06 14:51:39 +08:00
common.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
model_gate.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
pptx_render.py feat(preview): pptx 在线预览 —— LibreOffice→PDF + 复用 PDF iframe(DESIGN §8.3 Stage 1) 2026-06-09 13:04:02 +08:00
runs.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
schemas.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
sinks.py feat(broker): 外置 Redis pub/sub——蓝绿跨实例 SSE/cancel 可达(bump 0.42.0) 2026-07-06 14:51:39 +08:00
static_files.py Disable static asset caching 2026-06-08 09:16:31 +08:00
userfiles.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00