feat: 插件自动发现 — plugins.json + 代码生成器

- plugins.json 配置文件列出所有插件及其import路径
- gen_plugins.go 读取配置生成 plugins_gen.go
- main.go 调用 registerPlugins() 替代硬编码列表
- 新增 backend/plugins/ 第三方插件目录
- 插件开发文档: docs/api/plugin-development.md

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-24 19:30:52 +08:00
parent 2e94e7b0bf
commit cfebf5480e
5 changed files with 132 additions and 19 deletions
+12
View File
@@ -0,0 +1,12 @@
{
"version": "1.0",
"plugins": [
{ "name": "calculator", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/calculator", "struct": "CalculatorPlugin" },
{ "name": "datetime", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/datetime", "struct": "DatetimePlugin" },
{ "name": "text", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/text", "struct": "TextPlugin" },
{ "name": "crypto", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/crypto", "struct": "CryptoPlugin" },
{ "name": "random", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/random", "struct": "RandomPlugin" },
{ "name": "markdown", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/markdown", "struct": "MarkdownPlugin" },
{ "name": "json_ops", "import": "git.yeij.top/AskaEth/Cyrene-Plugins/json", "struct": "JSONPlugin" }
]
}