feat: 增强插件管理系统健壮性与可观测性#25
Closed
SSC-STUDIO wants to merge 1 commit into
Closed
Conversation
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
1. 插件管理器核心接口 (IPluginManager.cs)
InstallPluginAsync、UninstallPluginAsync和PermanentlyDeletePluginAsync异步插件管理接口。PerformPendingDeletionsAsync用于执行待处理的删除操作。CheckDependencies和GetDependentPlugins,支持插件依赖管理。CheckPluginHealth接口,用于验证插件健康状态。CheckForUpdatesAsync和HasUpdateAsync异步更新检查接口。2. 插件加载器 (PluginLoader.cs)
File.ReadAllBytesAsync。pluginLoadContext。3. 插件管理器实现 (PluginManager.cs)
IPluginManager中新增的异步插件管理、依赖检查、健康检查和更新检查方法。try-catch块包裹插件加载过程,并记录详细错误日志。4. 插件注册表 (PluginRegistry.cs)
GetAllMetadata接口及其线程安全实现,用于获取所有已注册插件的元数据快照。IsStarted接口,用于检查插件是否已启动。GetByAuthor接口,支持按作者筛选插件。IsRegistered和IsStarted方法中添加了空值参数校验。5. 插件状态定义 (PluginState.cs)
PluginHealthStatus枚举,包含Healthy、Warning、Error、NotFound、MissingDependencies和VersionIncompatible等状态,细化了插件健康状况的描述。💡 Technical Highlights