@using AIStudio.Agents.AssistantAudit @using AIStudio.Components @inherits MSGComponentBase @if (this.plugin is null) { @T("The assistant plugin could not be resolved for auditing.") } else { @T("This security check uses a sample prompt preview. Empty or placeholder values in the preview are expected.") @this.plugin.Name @this.plugin.Description @T("Audit provider"): @this.ProviderLabel @T("Minimum required safety level"): @this.MinimumLevelLabel
@T("System Prompt")
@T("Prompt Preview")
@T("Components")
@if (item.Value is AssistantAuditTreeItem treeItem) {
@treeItem.Text @if (!string.IsNullOrWhiteSpace(treeItem.Caption)) { if (treeItem.IsComponent) { @treeItem.Caption } else { @treeItem.Caption } }
}
@T("Plugin Structure")
@if (item.Value is AssistantAuditTreeItem treeItem) {
@treeItem.Text @if (!string.IsNullOrWhiteSpace(treeItem.Caption)) { @treeItem.Caption }
}
@T("Lua Manifest")
@foreach (var file in this.luaFiles) { var fileInfo = new FileInfo(Path.Combine(this.plugin.PluginPath, file.Key));
@file.Key @T("Size"): @this.FormatFileSize(fileInfo.Length) @T("Created"): @this.FormatFileTimestamp(fileInfo.CreationTime) @T("Last accessed"): @this.FormatFileTimestamp(fileInfo.LastAccessTime) @T("Last modified"): @this.FormatFileTimestamp(fileInfo.LastWriteTime) @file.Key
}
@if (this.audit is not null) { @T("Audit Result") @if (this.audit.Findings.Count == 0 && this.audit.Level is not AssistantAuditLevel.UNKNOWN) { @T("Safe"): @T("No security issues were found during this check.") } else { @this.audit.Level.GetName(): @this.audit.Summary @if (this.IsActivationBlockedBySettings) { @T("This plugin cannot be activated because its audit result is below the required safety level and your settings block activation in this case.") } else if (this.RequiresActivationConfirmation) { @T("This plugin is below the required safety level. Your settings still allow activation, but enabling it requires an extra confirmation because it may be unsafe.") } @T("Findings") @foreach (var finding in this.audit.Findings) { @finding.Category @finding.Severity.GetName() @if (!string.IsNullOrEmpty(finding.Location)) { @finding.Location } @finding.Description } } }
}
@(this.audit is null ? T("Cancel") : T("Close")) @T("Start Security Check") @if (this.CanEnablePlugin) { @T("Enable Assistant Plugin") }