Commit Graph

5 Commits

Author SHA1 Message Date
study-tool f8458cff51 feat(plugins): 插件支持热加载与启用/停用清单
- pugins/__init__.py 重写:load_plugins / discover / set_enabled / reload
- 热加载:把 study_tool.pugins.<名字> 的模块从 sys.modules 摘掉后重新 import;
  重载前先 registry.unregister 旧 id,平台 id 改了也不会留残影
- 启用清单存设置项 plugins({"disabled": [...]}):未列出的默认启用,新插件自动生效;
  停用即从注册表摘掉,/api/platforms 与账号平台下拉同步消失
- platforms/registry.py 新增 unregister(pid)
- 新接口:GET /api/plugins、POST /api/plugins/{name}/enable|disable、
  POST /api/plugins/reload、POST /api/plugins/{name}/reload;失败返回 ok=false
- 同步 docs/pugin.md(新增「加载与启停」)、docs/architecture.md、docs/OPTIMIZATION.md、AGENTS.md
2026-10-31 15:50:06 +08:00
study-tool bdd0bdf073 refactor(platforms): 平台插件改为 Platform 子类形态
Platform 由 dataclass 改为普通基类(类属性 + 方法槽位),禁止逐项传函数注册;gdgxk 与 guanyixue 完成迁移;AGENTS.md、architecture.md 同步新契约;新增 docs/pugin.md(骨架 / 槽位契约 / 开发与迁移流程 / 常见坑),OPTIMIZATION.md 补待测条目。
2026-10-31 15:07:25 +08:00
study-tool b1ccfe89f6 docs: 插件改为 Platform 子类形态,更新 pugin.md 契约与迁移步骤 2026-10-31 14:56:10 +08:00
study-tool 53bddbabaa docs: 按 json 驱动的插件方案更新 pugin.md
确定 pugin.json 为唯一权威:加载器读 json 注册,main.py 只提供函数;补加载器流程、schema 校验规则、迁移待办。
2026-10-31 14:51:42 +08:00
study-tool a6aa6a88f9 docs: 沉淀插件目录方案与开发流程(docs/pugin.md) 2026-10-31 14:43:15 +08:00