mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-04 18:09:40 +00:00
Added support for organization-approved assistant plugins (#821)
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
This commit is contained in:
1 parent
972ed73fe8
commit
13cc2f837a
35 files changed
+954
-62
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using SharedTools;
|
||||
|
||||
namespace Build.Commands;
|
||||
|
||||
public sealed class AssistantPluginHashCommand
|
||||
{
|
||||
[Command("assistant-plugin-hash", Description = "Compute the canonical assistant-plugin hash for a plugin directory")]
|
||||
public void ComputeAssistantPluginHash(
|
||||
[Argument(Description = "Path to the assistant plugin directory")] string pluginDir,
|
||||
[Option("lua-snippet", Description = "Also print a Lua snippet for CONFIG[\"SETTINGS\"]")] bool luaSnippet = false)
|
||||
{
|
||||
if (!Environment.IsWorkingDirectoryValid())
|
||||
return;
|
||||
|
||||
var resolvedPath = Path.GetFullPath(pluginDir, Directory.GetCurrentDirectory());
|
||||
if (!Directory.Exists(resolvedPath))
|
||||
{
|
||||
Console.WriteLine($"- Error: The plugin directory '{resolvedPath}' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
var pluginHash = AssistantPluginHash.Compute(resolvedPath);
|
||||
if (string.IsNullOrWhiteSpace(pluginHash))
|
||||
{
|
||||
Console.WriteLine($"- Error: No Lua files were found in '{resolvedPath}'.");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine(pluginHash);
|
||||
|
||||
if (!luaSnippet)
|
||||
return;
|
||||
|
||||
var displayName = Path.GetFileName(resolvedPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
|
||||
var approvedAtUtc = DateTimeOffset.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("""CONFIG["SETTINGS"]["DataAssistantPluginAudit.EnterpriseApprovedPlugins"] = {""");
|
||||
Console.WriteLine(" {");
|
||||
Console.WriteLine($""" ["PluginHash"] = "{pluginHash}",""");
|
||||
Console.WriteLine($""" ["DisplayName"] = "{displayName}",""");
|
||||
Console.WriteLine(""" ["Comment"] = "<optional comment>",""");
|
||||
Console.WriteLine(""" ["ApprovedBy"] = "<optional approver>",""");
|
||||
Console.WriteLine($""" ["ApprovedAtUtc"] = "{approvedAtUtc}",""");
|
||||
Console.WriteLine(" }");
|
||||
Console.WriteLine("}");
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,5 @@ app.AddCommands<CheckRidsCommand>();
|
||||
app.AddCommands<UpdateMetadataCommands>();
|
||||
app.AddCommands<UpdateWebAssetsCommand>();
|
||||
app.AddCommands<CollectI18NKeysCommand>();
|
||||
app.Run();
|
||||
app.AddCommands<AssistantPluginHashCommand>();
|
||||
app.Run();
|
||||
Reference in new issue
Block a user