mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-12 10:52:10 +00:00
parsing DEPLOYED_USING_CONFIG_SERVER from assistant plugins
This commit is contained in:
parent
a0065e628e
commit
2ff8a878bd
@ -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<LuaTable>(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<bool>(out var deployedUsingConfigServer))
|
||||
this.IsManagedByConfigServer = deployedUsingConfigServer;
|
||||
}
|
||||
|
||||
private bool TryReadLaunchConfiguration(LuaTable assistantTable, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user