- 引入了“hello_world_plugin”和“take_picture_plugin”及其各自的清单文件。 - 实现了“manifest_tool.py”,用于创建、验证和管理插件清单。 - 添加了“test_version_compatibility.py”,用于测试版本规范化、比较和兼容性检查。 - 增强了“manifest_utils.py”,增加了版本比较和验证功能。
64 lines
1.5 KiB
Python
64 lines
1.5 KiB
Python
"""
|
|
MaiBot 插件系统
|
|
|
|
提供统一的插件开发和管理框架
|
|
"""
|
|
|
|
# 导出主要的公共接口
|
|
from src.plugin_system.base.base_plugin import BasePlugin, register_plugin
|
|
from src.plugin_system.base.base_action import BaseAction
|
|
from src.plugin_system.base.base_command import BaseCommand
|
|
from src.plugin_system.base.config_types import ConfigField
|
|
from src.plugin_system.base.component_types import (
|
|
ComponentType,
|
|
ActionActivationType,
|
|
ChatMode,
|
|
ComponentInfo,
|
|
ActionInfo,
|
|
CommandInfo,
|
|
PluginInfo,
|
|
PythonDependency,
|
|
)
|
|
from src.plugin_system.core.plugin_manager import plugin_manager
|
|
from src.plugin_system.core.component_registry import component_registry
|
|
from src.plugin_system.core.dependency_manager import dependency_manager
|
|
|
|
# 导入工具模块
|
|
from src.plugin_system.utils import (
|
|
ManifestValidator,
|
|
ManifestGenerator,
|
|
validate_plugin_manifest,
|
|
generate_plugin_manifest
|
|
)
|
|
|
|
|
|
__version__ = "1.0.0"
|
|
|
|
__all__ = [
|
|
# 基础类
|
|
"BasePlugin",
|
|
"BaseAction",
|
|
"BaseCommand",
|
|
# 类型定义
|
|
"ComponentType",
|
|
"ActionActivationType",
|
|
"ChatMode",
|
|
"ComponentInfo",
|
|
"ActionInfo",
|
|
"CommandInfo",
|
|
"PluginInfo",
|
|
"PythonDependency",
|
|
# 管理器
|
|
"plugin_manager",
|
|
"component_registry",
|
|
"dependency_manager",
|
|
# 装饰器
|
|
"register_plugin",
|
|
"ConfigField",
|
|
# 工具函数
|
|
"ManifestValidator",
|
|
"ManifestGenerator",
|
|
"validate_plugin_manifest",
|
|
"generate_plugin_manifest",
|
|
]
|