From 38facf3e04b8a55b3e847727563230c2aa71454f Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 2 May 2025 11:27:21 +0200 Subject: [PATCH] Improved internal plugin maintenance (#436) --- .../PluginSystem/PluginFactory.Internal.cs | 20 +++++++++++++++++++ .../wwwroot/changelog/v0.9.42.md | 1 + 2 files changed, 21 insertions(+) diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Internal.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Internal.cs index 0a9e9dac..42165bfb 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Internal.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Internal.cs @@ -16,7 +16,27 @@ public static partial class PluginFactory return; } + // A plugin update might remove some resources. Even worse, a plugin + // might have changed its name, etc. Thus, we delete the internal + // plugin directories before copying the new resources: + LOG.LogInformation("Try to delete the internal plugins directory for maintenance."); + if (Directory.Exists(INTERNAL_PLUGINS_ROOT)) + { + try + { + Directory.Delete(INTERNAL_PLUGINS_ROOT, true); + LOG.LogInformation("Successfully deleted the internal plugins directory for maintenance."); + } + catch (Exception e) + { + LOG.LogError($"Could not delete the internal plugins directory for maintenance: {INTERNAL_PLUGINS_ROOT}. Error: {e}"); + } + } + LOG.LogInformation("Start ensuring internal plugins."); + if(!Directory.Exists(INTERNAL_PLUGINS_ROOT)) + Directory.CreateDirectory(INTERNAL_PLUGINS_ROOT); + foreach (var plugin in Enum.GetValues()) { LOG.LogInformation($"Ensure plugin: {plugin}"); diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.42.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.42.md index 86ae5402..fc7281d7 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.42.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.42.md @@ -1,5 +1,6 @@ # v0.9.42, build 217 (2025-05-xx xx:xx UTC) - Improved the model selection for OpenAI by removing all `o1-pro` models. These models cannot be used right now, since OpenAI introduced a new API, which is not yet supported by MindWork AI Studio. +- Improved the internal plugin maintenance so that removed resources are now removed from the file system. - Fixed an issue where empty lines in source code were being ignored by the Markdown renderer. Thanks My Nihongo for fixing this bug in the `MudBlazor.Markdown` repository. - Fixed the localization assistant not being able to load the localization file when used in the release app. - Upgraded .NET dependencies. \ No newline at end of file