From 3cef689c83a18a24bdc41619856d49e3293835e2 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 9 Apr 2026 10:08:37 +0200 Subject: [PATCH] Fixed issues (#723) --- .../Components/Workspaces.razor | 8 ++--- .../Assistants/PluginAssistants.cs | 20 +++++------ .../Tools/PluginSystem/PluginBase.Icon.cs | 2 +- .../Tools/PluginSystem/PluginBase.cs | 34 +++++++++---------- .../Tools/PluginSystem/PluginConfiguration.cs | 4 +-- .../Tools/PluginSystem/PluginLanguage.cs | 10 +++--- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/app/MindWork AI Studio/Components/Workspaces.razor b/app/MindWork AI Studio/Components/Workspaces.razor index 25a9ef3f..75d840e9 100644 --- a/app/MindWork AI Studio/Components/Workspaces.razor +++ b/app/MindWork AI Studio/Components/Workspaces.razor @@ -24,7 +24,7 @@ else case TreeItemData treeItem: @if (treeItem.Type is TreeItemType.LOADING) { - + @@ -32,7 +32,7 @@ else } else if (treeItem.Type is TreeItemType.CHAT) { - +
@@ -65,7 +65,7 @@ else } else if (treeItem.Type is TreeItemType.WORKSPACE) { - +
@@ -86,7 +86,7 @@ else } else { - +
diff --git a/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs b/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs index fabff590..f5cca120 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs @@ -43,7 +43,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType public void TryLoad() { if(!this.TryProcessAssistant(out var issue)) - this.pluginIssues.Add(issue); + this.PluginIssues.Add(issue); } /// @@ -65,7 +65,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType this.RegisterLuaHelpers(); // Ensure that the main ASSISTANT table exists and is a valid Lua table: - if (!this.state.Environment["ASSISTANT"].TryRead(out var assistantTable)) + if (!this.State.Environment["ASSISTANT"].TryRead(out var assistantTable)) { message = TB("The ASSISTANT lua table does not exist or is not a valid table."); return false; @@ -148,7 +148,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType try { cancellationToken.ThrowIfCancellationRequested(); - var results = await this.state.CallAsync(this.buildPromptFunction, [input], cancellationToken); + var results = await this.State.CallAsync(this.buildPromptFunction, [input], cancellationToken); if (results.Length == 0) return string.Empty; @@ -276,7 +276,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType try { cancellationToken.ThrowIfCancellationRequested(); - var results = await this.state.CallAsync(callback, [input], cancellationToken); + var results = await this.State.CallAsync(callback, [input], cancellationToken); if (results.Length == 0) return null; @@ -498,7 +498,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType private void RegisterLuaHelpers() { - this.state.Environment["LogInfo"] = new LuaFunction((context, _) => + this.State.Environment["LogInfo"] = new LuaFunction((context, _) => { if (context.ArgumentCount == 0) return new(0); @@ -507,7 +507,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType return new(0); }); - this.state.Environment["LogDebug"] = new LuaFunction((context, _) => + this.State.Environment["LogDebug"] = new LuaFunction((context, _) => { if (context.ArgumentCount == 0) return new(0); @@ -516,7 +516,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType return new(0); }); - this.state.Environment["LogWarning"] = new LuaFunction((context, _) => + this.State.Environment["LogWarning"] = new LuaFunction((context, _) => { if (context.ArgumentCount == 0) return new(0); @@ -525,7 +525,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType return new(0); }); - this.state.Environment["LogError"] = new LuaFunction((context, _) => + this.State.Environment["LogError"] = new LuaFunction((context, _) => { if (context.ArgumentCount == 0) return new(0); @@ -534,7 +534,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType return new(0); }); - this.state.Environment["DateTime"] = new LuaFunction((context, _) => + this.State.Environment["DateTime"] = new LuaFunction((context, _) => { var format = context.ArgumentCount > 0 ? context.GetArgument(0) : "yyyy-MM-dd HH:mm:ss"; var now = DateTime.Now; @@ -554,7 +554,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType return new(context.Return(table)); }); - this.state.Environment["Timestamp"] = new LuaFunction((context, _) => + this.State.Environment["Timestamp"] = new LuaFunction((context, _) => { var timestamp = DateTime.UtcNow.ToString("o"); return new(context.Return(timestamp)); diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs index 5c6140c8..60f14acb 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs @@ -23,7 +23,7 @@ public abstract partial class PluginBase // ReSharper disable once UnusedMethodReturnValue.Local private bool TryInitIconSVG(out string message, out string iconSVG) { - if (!this.state.Environment["ICON_SVG"].TryRead(out iconSVG)) + if (!this.State.Environment["ICON_SVG"].TryRead(out iconSVG)) { iconSVG = DEFAULT_ICON_SVG; message = "The field ICON_SVG does not exist or is not a valid string."; diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs index b6377a99..eeafa119 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs @@ -11,9 +11,9 @@ public abstract partial class PluginBase : IPluginMetadata private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(PluginBase).Namespace, nameof(PluginBase)); private readonly IReadOnlyCollection baseIssues; - protected readonly LuaState state; + protected readonly LuaState State; - protected readonly List pluginIssues = []; + protected readonly List PluginIssues = []; /// public string IconSVG { get; } @@ -65,7 +65,7 @@ public abstract partial class PluginBase : IPluginMetadata /// /// The issues that occurred during the initialization of this plugin. /// - public IEnumerable Issues => this.baseIssues.Concat(this.pluginIssues); + public IEnumerable Issues => this.baseIssues.Concat(this.PluginIssues); /// /// True, when the plugin is valid. @@ -74,11 +74,11 @@ public abstract partial class PluginBase : IPluginMetadata /// False means that there were issues during the initialization of the plugin. /// Please check the Issues property for more information. /// - public bool IsValid => this is not NoPlugin && this.baseIssues.Count == 0 && this.pluginIssues.Count == 0; + public bool IsValid => this is not NoPlugin && this.baseIssues.Count == 0 && this.PluginIssues.Count == 0; protected PluginBase(bool isInternal, LuaState state, PluginType type, string parseError = "") { - this.state = state; + this.State = state; this.Type = type; var issues = new List(); @@ -160,7 +160,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the ID could be read successfully. private bool TryInitId(out string message, out Guid id) { - if (!this.state.Environment["ID"].TryRead(out var idText)) + if (!this.State.Environment["ID"].TryRead(out var idText)) { message = TB("The field ID does not exist or is not a valid string."); id = Guid.Empty; @@ -192,7 +192,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the name could be read successfully. private bool TryInitName(out string message, out string name) { - if (!this.state.Environment["NAME"].TryRead(out name)) + if (!this.State.Environment["NAME"].TryRead(out name)) { message = TB("The field NAME does not exist or is not a valid string."); name = string.Empty; @@ -217,7 +217,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the description could be read successfully. private bool TryInitDescription(out string message, out string description) { - if (!this.state.Environment["DESCRIPTION"].TryRead(out description)) + if (!this.State.Environment["DESCRIPTION"].TryRead(out description)) { message = TB("The field DESCRIPTION does not exist or is not a valid string."); description = string.Empty; @@ -242,7 +242,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the version could be read successfully. private bool TryInitVersion(out string message, out PluginVersion version) { - if (!this.state.Environment["VERSION"].TryRead(out var versionText)) + if (!this.State.Environment["VERSION"].TryRead(out var versionText)) { message = TB("The field VERSION does not exist or is not a valid string."); version = PluginVersion.NONE; @@ -274,7 +274,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the authors could be read successfully. private bool TryInitAuthors(out string message, out string[] authors) { - if (!this.state.Environment["AUTHORS"].TryRead(out var authorsTable)) + if (!this.State.Environment["AUTHORS"].TryRead(out var authorsTable)) { authors = []; message = TB("The table AUTHORS does not exist or is using an invalid syntax."); @@ -305,7 +305,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the support contact could be read successfully. private bool TryInitSupportContact(out string message, out string contact) { - if (!this.state.Environment["SUPPORT_CONTACT"].TryRead(out contact)) + if (!this.State.Environment["SUPPORT_CONTACT"].TryRead(out contact)) { contact = string.Empty; message = TB("The field SUPPORT_CONTACT does not exist or is not a valid string."); @@ -330,7 +330,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the source URL could be read successfully. private bool TryInitSourceURL(out string message, out string url) { - if (!this.state.Environment["SOURCE_URL"].TryRead(out url)) + if (!this.State.Environment["SOURCE_URL"].TryRead(out url)) { url = string.Empty; message = TB("The field SOURCE_URL does not exist or is not a valid string."); @@ -395,7 +395,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the categories could be read successfully. private bool TryInitCategories(out string message, out PluginCategory[] categories) { - if (!this.state.Environment["CATEGORIES"].TryRead(out var categoriesTable)) + if (!this.State.Environment["CATEGORIES"].TryRead(out var categoriesTable)) { categories = []; message = TB("The table CATEGORIES does not exist or is using an invalid syntax."); @@ -427,7 +427,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the target groups could be read successfully. private bool TryInitTargetGroups(out string message, out PluginTargetGroup[] targetGroups) { - if (!this.state.Environment["TARGET_GROUPS"].TryRead(out var targetGroupsTable)) + if (!this.State.Environment["TARGET_GROUPS"].TryRead(out var targetGroupsTable)) { targetGroups = []; message = TB("The table TARGET_GROUPS does not exist or is using an invalid syntax."); @@ -459,7 +459,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the maintenance status could be read successfully. private bool TryInitIsMaintained(out string message, out bool isMaintained) { - if (!this.state.Environment["IS_MAINTAINED"].TryRead(out isMaintained)) + if (!this.State.Environment["IS_MAINTAINED"].TryRead(out isMaintained)) { isMaintained = false; message = TB("The field IS_MAINTAINED does not exist or is not a valid boolean."); @@ -478,7 +478,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the deprecation message could be read successfully. private bool TryInitDeprecationMessage(out string message, out string deprecationMessage) { - if (!this.state.Environment["DEPRECATION_MESSAGE"].TryRead(out deprecationMessage)) + if (!this.State.Environment["DEPRECATION_MESSAGE"].TryRead(out deprecationMessage)) { deprecationMessage = string.Empty; message = TB("The field DEPRECATION_MESSAGE does not exist, is not a valid string. This message is optional: use an empty string to indicate that the plugin is not deprecated."); @@ -497,7 +497,7 @@ public abstract partial class PluginBase : IPluginMetadata /// True, when the UI text content could be read successfully. protected bool TryInitUITextContent(out string message, out Dictionary pluginContent) { - if (!this.state.Environment["UI_TEXT_CONTENT"].TryRead(out var textTable)) + if (!this.State.Environment["UI_TEXT_CONTENT"].TryRead(out var textTable)) { message = TB("The UI_TEXT_CONTENT table does not exist or is not a valid table."); pluginContent = []; diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs index 99031624..9e07452d 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs @@ -26,7 +26,7 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT public async Task InitializeAsync(bool dryRun) { if(!this.TryProcessConfiguration(dryRun, out var issue)) - this.pluginIssues.Add(issue); + this.PluginIssues.Add(issue); if (!dryRun) { @@ -93,7 +93,7 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT this.configObjects.Clear(); // Ensure that the main CONFIG table exists and is a valid Lua table: - if (!this.state.Environment["CONFIG"].TryRead(out var mainTable)) + if (!this.State.Environment["CONFIG"].TryRead(out var mainTable)) { message = TB("The CONFIG table does not exist or is not a valid table."); return false; diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginLanguage.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginLanguage.cs index d3dcb8de..466eca2f 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginLanguage.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginLanguage.cs @@ -17,15 +17,15 @@ public sealed class PluginLanguage : PluginBase, ILanguagePlugin public PluginLanguage(bool isInternal, LuaState state, PluginType type) : base(isInternal, state, type) { if(!this.TryInitIETFTag(out var issue, out this.langCultureTag)) - this.pluginIssues.Add(issue); + this.PluginIssues.Add(issue); if(!this.TryInitLangName(out issue, out this.langName)) - this.pluginIssues.Add(issue); + this.PluginIssues.Add(issue); if (this.TryInitUITextContent(out issue, out var readContent)) this.content = readContent; else - this.pluginIssues.Add(issue); + this.PluginIssues.Add(issue); } /// @@ -52,7 +52,7 @@ public sealed class PluginLanguage : PluginBase, ILanguagePlugin /// True, when the IETF tag could be read, false otherwise. private bool TryInitIETFTag(out string message, out string readLangCultureTag) { - if (!this.state.Environment["IETF_TAG"].TryRead(out readLangCultureTag)) + if (!this.State.Environment["IETF_TAG"].TryRead(out readLangCultureTag)) { message = TB("The field IETF_TAG does not exist or is not a valid string."); readLangCultureTag = string.Empty; @@ -104,7 +104,7 @@ public sealed class PluginLanguage : PluginBase, ILanguagePlugin private bool TryInitLangName(out string message, out string readLangName) { - if (!this.state.Environment["LANG_NAME"].TryRead(out readLangName)) + if (!this.State.Environment["LANG_NAME"].TryRead(out readLangName)) { message = TB("The field LANG_NAME does not exist or is not a valid string."); readLangName = string.Empty;