astrbot_plugin_imagestudio/backend
2026-07-13 00:14:22 +08:00
..
dto release: publish ImageStudio 1.0.0 2026-07-12 02:54:45 +08:00
routes release: publish ImageStudio 1.0.0 2026-07-12 02:54:45 +08:00
services release: publish ImageStudio 1.0.6 2026-07-13 00:14:22 +08:00
__init__.py chore: initialize v3 plugin scaffold 2026-07-04 22:51:52 +08:00
README.md feat: complete ImageStudio workbench UI and integration audit 2026-07-11 21:50:34 +08:00
route_registry.py release: publish ImageStudio 1.0.0 2026-07-12 02:54:45 +08:00

Backend

后端由 AstrBot 插件生命周期托管,不启动独立 Web 服务。

  • main.py 中的 Star 子类在 initialize() 阶段调用 context.register_web_api。
  • terminate() 用于插件停用或重载时清理资源。
  • route registry 和业务层只维护 ui/bootstrap、profiles、nodes/{node_id}/generate 等相对 endpoint。
  • AstrBot v4.25 插件页面 bridge 兼容 /api/plug/astrbot_plugin_imagestudio/<endpoint>。
  • 当前直接调用兼容 /api/v1/plugins/extensions/astrbot_plugin_imagestudio/<endpoint>。
  • 前端 bridge 必须传相对 endpoint,不能传完整宿主 URL。

插件 UI 由 pages/imagestudio/index.html 自动发现。未注册的 /web 目录不是生产入口。

SQLite、媒体、日志和缓存等运行数据应写入 data/plugin_data/astrbot_plugin_imagestudio/,不要写入插件源码目录。

当前 API 的产品边界是可信 AstrBot WebUI 管理员工作台。角色档案已按调用身份过滤,但其他资源尚未完成统一祖先链 owner 授权;在补齐该授权与跨用户回归测试前,不应把本插件作为互不信任用户共享的多租户服务发布。