Added detailed plugin information to the plugins page (#1013)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
nilskruthoffandThorsten Sommer authored and GitHub committed 2026-10-12 18:02:28 +02:00
1 parent b371b3d54f
commit f912af321f
26 files changed
+884 -95

No files matched your search

@@ -69,11 +69,15 @@ public static class DirectChatLauncherLuaWriter
/// <summary>
/// Writes the complete plugin.lua for an installed launcher whose settings changed.
/// </summary>
/// <remarks>
/// All metadata is carried over except the time of the last change: changing the settings
/// changes the plugin, so that time becomes now.
/// </remarks>
/// <param name="plugin">The installed launcher whose metadata is carried over.</param>
/// <param name="definition">The name, title, description, and chat settings the user chose.</param>
/// <returns>The plugin.lua content, ready to be validated and written.</returns>
public static string Write(PluginAssistants plugin, DirectChatLauncherDefinition definition) =>
Write(DirectChatLauncherPluginMetadata.FromPlugin(plugin), definition);
Write(DirectChatLauncherPluginMetadata.FromPlugin(plugin) with { LastChanged = DateTimeOffset.UtcNow }, definition);
/// <summary>
/// Writes the complete plugin.lua for a launcher.
@@ -114,6 +118,13 @@ public static class DirectChatLauncherLuaWriter
builder.AppendLine($"VERSION = \"{plugin.Version}\"");
builder.AppendLine();
if (plugin.LastChanged is { } lastChanged)
{
builder.AppendLine("-- When this plugin was last changed, in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ. Optional.");
builder.AppendLine($"LAST_CHANGED = \"{PluginBase.FormatLastChanged(lastChanged)}\"");
builder.AppendLine();
}
builder.AppendLine("-- The type of the plugin:");
builder.AppendLine($"TYPE = \"{nameof(PluginType.ASSISTANT)}\"");
builder.AppendLine();
@@ -10,6 +10,7 @@ namespace AIStudio.Tools.PluginSystem.Assistants;
/// </remarks>
/// <param name="Id">The plugin ID, which stays with the plugin for its whole life.</param>
/// <param name="Version">The plugin version, as it appears in the Lua file.</param>
/// <param name="LastChanged">When the plugin was last changed, in UTC, when it states it.</param>
/// <param name="Authors">The authors of the plugin.</param>
/// <param name="SupportContact">Where users turn with questions about this plugin.</param>
/// <param name="SourceURL">Where the plugin comes from.</param>
@@ -18,12 +19,12 @@ namespace AIStudio.Tools.PluginSystem.Assistants;
/// <param name="IsMaintained">Whether the plugin is still maintained.</param>
/// <param name="DeprecationMessage">What users are told when the plugin is deprecated.</param>
/// <param name="IsAssistantBuilderGenerated">Whether the Assistant Builder created this plugin.</param>
public sealed record DirectChatLauncherPluginMetadata(Guid Id, string Version, IReadOnlyList<string> Authors, string SupportContact, string SourceURL,
public sealed record DirectChatLauncherPluginMetadata(Guid Id, string Version, DateTimeOffset? LastChanged, IReadOnlyList<string> Authors, string SupportContact, string SourceURL,
IReadOnlyList<PluginCategory> Categories, IReadOnlyList<PluginTargetGroup> TargetGroups, bool IsMaintained, string DeprecationMessage, bool IsAssistantBuilderGenerated)
{
/// <summary>
/// Takes the metadata of an installed launcher for the case where one is edited.
/// </summary>
public static DirectChatLauncherPluginMetadata FromPlugin(PluginAssistants plugin) => new(plugin.Id, plugin.Version.ToString(), plugin.Authors,
public static DirectChatLauncherPluginMetadata FromPlugin(PluginAssistants plugin) => new(plugin.Id, plugin.Version.ToString(), plugin.LastChanged, plugin.Authors,
plugin.SupportContact, plugin.SourceURL, plugin.Categories, plugin.TargetGroups, plugin.IsMaintained, plugin.DeprecationMessage, plugin.IsAssistantBuilderGenerated);
}