diff --git a/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs b/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs index 6773161e..b16910ac 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/Assistants/PluginAssistants.cs @@ -37,6 +37,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType public bool HasEmbeddedProfileSelection { get; private set; } public bool HasCustomPromptBuilder => this.buildPromptFunction is not null; public bool IsAssistantBuilderGenerated { get; private set; } + public bool IsManagedByConfigServer { get; private set; } public AssistantPluginLaunchBehavior LaunchBehavior { get; private set; } public string LaunchWorkspaceName { get; private set; } = string.Empty; public bool StartsChatDirectly => this.LaunchBehavior is AssistantPluginLaunchBehavior.OPEN_WORKSPACE_CHAT_BY_NAME; @@ -65,12 +66,14 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType message = string.Empty; this.HasEmbeddedProfileSelection = false; this.IsAssistantBuilderGenerated = false; + this.IsManagedByConfigServer = false; this.buildPromptFunction = null; this.LaunchBehavior = AssistantPluginLaunchBehavior.NONE; this.LaunchWorkspaceName = string.Empty; this.RegisterLuaHelpers(); this.TryReadAssistantBuilderMetadata(); + this.TryReadDeploymentMetadata(); // Ensure that the main ASSISTANT table exists and is a valid Lua table: if (!this.State.Environment["ASSISTANT"].TryRead(out var assistantTable)) @@ -163,6 +166,12 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType this.IsAssistantBuilderGenerated = generated; } + private void TryReadDeploymentMetadata() + { + if (this.State.Environment["DEPLOYED_USING_CONFIG_SERVER"].TryRead(out var deployedUsingConfigServer)) + this.IsManagedByConfigServer = deployedUsingConfigServer; + } + private bool TryReadLaunchConfiguration(LuaTable assistantTable, out string message) { message = string.Empty; diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs index 56f3ea23..9a637880 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs @@ -121,6 +121,8 @@ public static partial class PluginFactory LOG.LogWarning($"The configuration plugin '{plugin.Id}' does not define 'DEPLOYED_USING_CONFIG_SERVER'. Falling back to the plugin path and treating it as managed because it is stored under '{CONFIGURATION_PLUGINS_ROOT}'."); } } + else if (plugin is PluginAssistants assistantPlugin) + isManagedByConfigServer = assistantPlugin.IsManagedByConfigServer; // For configuration plugins, validate that the plugin ID matches the enterprise config ID // (the directory name under which the plugin was downloaded):