Moved the background agents to AI operations (#1215)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-21 19:47:10 +01:00
1 parent 8a4a26503b
commit c50a93cd17
139 files changed
+4069 -2340

No files matched your search

@@ -1,4 +1,4 @@
@using AIStudio.Agents.AssistantAudit
@using AIStudio.AIOperations.PluginAudit
@inherits MSGComponentBase
<MudDialog DefaultFocus="DefaultFocus.FirstChild">
@@ -40,7 +40,7 @@
{
<MudPaper Class="pa-3 border-dashed border rounded-lg">
<MudText Typo="Typo.body2" Class="mb-3">
@TA("No model is set for security checks, neither for this agent nor for the app as a whole. Choose one here to check this plugin. Your choice applies to this check only; you can set a permanent one in the app settings.")
@this.ProviderSelectionHint
</MudText>
<CascadingValue Value="Components.AGENT_ASSISTANT_PLUGIN_AUDIT">
<ProviderSelection @bind-ProviderSettings="@this.auditProviderSelection" ValidateProvider="@this.ValidatingProvider" Label="@T("Model")" Disabled="@this.isAuditing" />
@@ -210,7 +210,7 @@
<MudStack Spacing="2" Class="mt-4">
<MudText Typo="Typo.h6">@T("Audit Result")</MudText>
@if (this.audit.Findings.Count == 0 && this.audit.Level is not AssistantAuditLevel.UNKNOWN)
@if (this.audit.Findings.Count == 0 && this.audit.Level is not PluginAuditLevel.UNKNOWN)
{
<MudAlert Severity="Severity.Success" Variant="Variant.Filled" Dense="true" Icon="@AppIcons.AUDIT_SAFE">
<strong>@T("Safe")</strong><span>: @T("No security issues were found during this check.")</span>
@@ -241,22 +241,22 @@
{
var severityUi = finding.Severity switch
{
AssistantAuditLevel.UNKNOWN => (
PluginAuditLevel.UNKNOWN => (
AlertStyling: "color: rgb(12,128,223); background-color: rgba(33,150,243,0.06);",
AlertIcon: AppIcons.UNKNOWN,
ChipColor: Color.Info
),
AssistantAuditLevel.DANGEROUS => (
PluginAuditLevel.DANGEROUS => (
AlertStyling: "color: rgb(242,28,13); background-color: rgba(244,67,54,0.06);",
AlertIcon: AppIcons.SECURITY_DANGEROUS,
ChipColor: Color.Error
),
AssistantAuditLevel.CAUTION => (
PluginAuditLevel.CAUTION => (
AlertStyling: "color: rgb(214,129,0); background-color: rgba(255,152,0,0.06);",
AlertIcon: AppIcons.WARNING,
ChipColor: Color.Warning
),
AssistantAuditLevel.SAFE => (
PluginAuditLevel.SAFE => (
AlertStyling: "color: rgb(0,163,68); background-color: rgba(0,200,83,0.06);",
AlertIcon: AppIcons.AUDIT_SAFE,
ChipColor: Color.Success
@@ -2,7 +2,8 @@ using System.Collections;
using System.Collections.Immutable;
using System.Globalization;
using System.Reflection;
using AIStudio.Agents.AssistantAudit;
using AIStudio.AIOperations;
using AIStudio.AIOperations.PluginAudit;
using AIStudio.Components;
using AIStudio.Provider;
using AIStudio.Settings.DataModel;
@@ -26,6 +27,9 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
[Inject]
private IDialogService DialogService { get; init; } = null!;
[Inject]
private AIOperationProviderResolver ProviderResolver { get; init; } = null!;
[Parameter] public Guid PluginId { get; set; }
private PluginAssistants? plugin;
@@ -40,7 +44,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
private PluginAssistantSecurityState securityState = new();
/// <summary>
/// The provider the user picks inside this dialog when nothing is configured for the audit agent.
/// The provider the user picks inside this dialog when nothing is configured for the audit.
/// </summary>
/// <remarks>
/// It lives and dies with this dialog and is never written to the settings: an audit is a one-off
@@ -48,19 +52,34 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
/// </remarks>
private AIStudio.Settings.Provider auditProviderSelection = AIStudio.Settings.Provider.NONE;
private AIStudio.Settings.Provider CurrentProvider => this.SettingsManager.GetPreselectedProvider(Tools.Components.AGENT_ASSISTANT_PLUGIN_AUDIT, null, true);
/// <summary>
/// The provider an audit would run with without a choice in this dialog, and why others were not chosen.
/// </summary>
private AIOperationProviderChoice ConfiguredChoice => this.ProviderResolver.Preview(PluginAuditOperation.GetProviderSettings(this.SettingsManager), ConfidenceLevel.NONE, AssistantPluginAuditService.GetProviderOptions(this.SettingsManager, null));
/// <summary>
/// The provider this audit runs with: the configured one, or what the user picked here instead.
/// </summary>
private AIStudio.Settings.Provider EffectiveProvider => this.CurrentProvider == AIStudio.Settings.Provider.NONE
? this.auditProviderSelection
: this.CurrentProvider;
/// <remarks>
/// Chosen as the audit service chooses, so that the dialog never names a provider the audit would refuse.
/// </remarks>
private AIStudio.Settings.Provider EffectiveProvider => this.ProviderResolver.Preview(PluginAuditOperation.GetProviderSettings(this.SettingsManager), ConfidenceLevel.NONE, AssistantPluginAuditService.GetProviderOptions(this.SettingsManager, this.auditProviderSelection)).Provider;
/// <summary>
/// Whether this dialog has to offer a provider, because neither the audit agent nor the app has one.
/// Whether this dialog has to offer a provider, because neither the audit nor the app has a usable one.
/// </summary>
private bool NeedsProviderSelection => this.CurrentProvider == AIStudio.Settings.Provider.NONE;
private bool NeedsProviderSelection => !this.ConfiguredChoice.HasProvider;
/// <summary>
/// Says why this dialog offers a provider: none is set, or the one set cannot be used.
/// </summary>
private string ProviderSelectionHint => AssistantPluginAuditService.GetRelevantIssue(this.ConfiguredChoice) switch
{
AIOperationProviderIssue.NOT_SET => TA("No model is set for security checks, neither for this AI task nor for the app as a whole. Choose one here to check this plugin. Your choice applies to this check only; you can set a permanent one in the app settings."),
AIOperationProviderIssue.MISSING => TA("The model set for security checks no longer exists. Choose one here to check this plugin. Your choice applies to this check only; you can set a permanent one in the app settings."),
AIOperationProviderIssue.PROHIBITED => TA("Your organization does not allow the model set for security checks. Choose one here to check this plugin. Your choice applies to this check only; you can set a permanent one in the app settings."),
_ => TA("The model set for security checks is not trusted enough for them. Choose one here to check this plugin. Your choice applies to this check only; you can set a permanent one in the app settings."),
};
private string ProviderLabel => this.EffectiveProvider == AIStudio.Settings.Provider.NONE
? T("No model configured")
@@ -68,7 +87,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
private DataAssistantPluginAudit AuditSettings => this.SettingsManager.ConfigurationData.AssistantPluginAudit;
private AssistantAuditLevel MinimumLevel => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumLevel;
private PluginAuditLevel MinimumLevel => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumLevel;
private string MinimumLevelLabel => this.MinimumLevel.Name;
@@ -87,7 +106,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
/// audits. What the dialog shows the user still reads the raw result: a failed run is precisely
/// what they need to see.
/// </remarks>
private PluginAssistantAudit? ConclusiveAudit => this.audit is { Level: not AssistantAuditLevel.UNKNOWN } ? this.audit : null;
private PluginAssistantAudit? ConclusiveAudit => this.audit is { Level: not PluginAuditLevel.UNKNOWN } ? this.audit : null;
private bool IsAuditBelowMinimum => this.ConclusiveAudit is not null && this.ConclusiveAudit.Level < this.MinimumLevel;
@@ -144,10 +163,10 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
{
//
// The provider picked here is handed over as the fallback: the audit service uses it only
// when nothing is configured for the audit agent, so an organization-wide provider keeps
// when nothing is configured for the audit, so an organization-wide provider keeps
// its precedence.
//
this.audit = await this.AssistantPluginAuditService.RunAuditAsync(this.plugin, fallbackProvider: this.auditProviderSelection);
this.audit = await this.AssistantPluginAuditService.RunAuditAsync(this.plugin, providerAtHand: this.auditProviderSelection);
this.securityState = PluginAssistantSecurityResolver.Resolve(this.SettingsManager, this.plugin);
}
finally
@@ -212,9 +231,9 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
private Severity GetAuditResultSeverity() => this.audit?.Level switch
{
AssistantAuditLevel.DANGEROUS => Severity.Error,
AssistantAuditLevel.CAUTION => Severity.Warning,
AssistantAuditLevel.SAFE => Severity.Success,
PluginAuditLevel.DANGEROUS => Severity.Error,
PluginAuditLevel.CAUTION => Severity.Warning,
PluginAuditLevel.SAFE => Severity.Success,
_ => Severity.Normal,
};
@@ -1,5 +1,5 @@
using System.Text;
using AIStudio.Agents.AssistantAudit;
using AIStudio.AIOperations.PluginAudit;
using AIStudio.Components;
using AIStudio.Provider;
using AIStudio.Tools.PluginSystem;
@@ -200,11 +200,11 @@ public partial class AssistantPluginRevisionDialog : MSGComponentBase
{
//
// The provider the user picked for the revision serves as the fallback: it is used only
// when nothing is configured for the audit agent, and only when it is trusted enough for
// when nothing is configured for the audit, and only when it is trusted enough for
// an audit. Without it, a revised plugin could not be checked at all here.
//
var audit = await this.AssistantPluginAuditService.RunAuditAsync(updatedPlugin, fallbackProvider: this.providerSettings);
if (audit.Level is AssistantAuditLevel.UNKNOWN)
var audit = await this.AssistantPluginAuditService.RunAuditAsync(updatedPlugin, providerAtHand: this.providerSettings);
if (audit.Level is PluginAuditLevel.UNKNOWN)
return audit;
UpsertAudit(this.SettingsManager.ConfigurationData.AssistantPluginAudits, audit);
@@ -1,5 +1,5 @@
using System.Text;
using AIStudio.Agents.AssistantAudit;
using AIStudio.AIOperations.PluginAudit;
using AIStudio.Components;
using AIStudio.Tools.PluginSystem;
using AIStudio.Tools.PluginSystem.Assistants;
@@ -231,7 +231,7 @@ public partial class DirectChatLauncherSettingsDialog : MSGComponentBase
try
{
var audit = await this.AssistantPluginAuditService.RunAuditAsync(updatedPlugin);
if (audit.Level is AssistantAuditLevel.UNKNOWN)
if (audit.Level is PluginAuditLevel.UNKNOWN)
return audit;
UpsertAudit(this.SettingsManager.ConfigurationData.AssistantPluginAudits, audit);
@@ -12,7 +12,7 @@
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect legal check options?")" LabelOn="@T("Legal check options are preselected")" LabelOff="@T("No legal check options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect some legal check options. This might be useful when you prefer a specific LLM model.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the web content reader?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions || this.SettingsManager.ConfigurationData.LegalCheck.HideWebContentReader)" LabelOn="@T("Web content reader is preselected")" LabelOff="@T("Web content reader is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.LegalCheck.PreselectWebContentReader)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.LegalCheck.PreselectWebContentReader = updatedState)" OptionHelp="@TA("When enabled, the web content reader is preselected. This might be useful when you prefer to load legal content from the web very often.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the content cleaner agent?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions || this.SettingsManager.ConfigurationData.LegalCheck.HideWebContentReader)" LabelOn="@T("Content cleaner agent is preselected")" LabelOff="@T("Content cleaner agent is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.LegalCheck.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.LegalCheck.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the content cleaner agent is preselected. This might be useful when you prefer to clean up the legal content before translating it.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the text content cleaner?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions || this.SettingsManager.ConfigurationData.LegalCheck.HideWebContentReader)" LabelOn="@T("Text content cleaner is preselected")" LabelOff="@T("Text content cleaner is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.LegalCheck.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.LegalCheck.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the text content cleaner is preselected. This might be useful when you prefer to clean up the legal content before translating it.")"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.LegalCheck.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.LegalCheck.MinimumProviderConfidence = selectedValue)"/>
<ConfigurationProviderSelection Component="Components.LEGAL_CHECK_ASSISTANT" Data="@this.AvailableLLMProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.LegalCheck.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.LegalCheck.PreselectedProvider = selectedValue)"/>
<ConfigurationSelect OptionDescription="@T("Preselect a profile")" Disabled="@(() => !this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions)" SelectedValue="@(() => ProfilePreselection.FromStoredValue(this.SettingsManager.ConfigurationData.LegalCheck.PreselectedProfile))" Data="@ConfigurationSelectDataFactory.GetComponentProfilesData(this.SettingsManager.ConfigurationData.Profiles)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.LegalCheck.PreselectedProfile = selectedValue)" OptionHelp="@TA("Choose whether the assistant should use the app default profile, no profile, or a specific profile.")"/>
@@ -13,7 +13,7 @@
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect SWOT analysis options?")" LabelOn="@T("SWOT analysis options are preselected")" LabelOff="@T("No SWOT analysis options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the SWOT analysis options. This is useful when you prefer a specific language, analysis focus, or LLM.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the web content reader?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions || this.SettingsManager.ConfigurationData.SWOTAnalysis.HideWebContentReader)" LabelOn="@T("Web content reader is preselected")" LabelOff="@T("Web content reader is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectWebContentReader)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectWebContentReader = updatedState)" OptionHelp="@TA("When enabled, the web content reader is preselected. This is useful when you often analyze content from websites.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the content cleaner agent?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions || this.SettingsManager.ConfigurationData.SWOTAnalysis.HideWebContentReader)" LabelOn="@T("Content cleaner agent is preselected")" LabelOff="@T("Content cleaner agent is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectContentCleanerAgent = updatedState)" OptionHelp="@T("When enabled, the content cleaner agent is preselected for cleaning website content before it is analyzed.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the text content cleaner?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions || this.SettingsManager.ConfigurationData.SWOTAnalysis.HideWebContentReader)" LabelOn="@T("Text content cleaner is preselected")" LabelOff="@T("Text content cleaner is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectContentCleanerAgent = updatedState)" OptionHelp="@T("When enabled, the text content cleaner is preselected for cleaning website content before it is analyzed.")"/>
<ConfigurationSelect OptionDescription="@T("Preselect the target language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectedTargetLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectedTargetLanguage = selectedValue)" OptionHelp="@T("Which target language should be preselected?")"/>
@if (this.SettingsManager.ConfigurationData.SWOTAnalysis.PreselectedTargetLanguage is CommonLanguages.OTHER)
{
@@ -14,7 +14,7 @@
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect summarizer options?")" LabelOn="@T("Summarizer options are preselected")" LabelOff="@T("No summarizer options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the text summarizer options. This might be useful when you prefer a specific language, complexity, or LLM.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the web content reader?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions || this.SettingsManager.ConfigurationData.TextSummarizer.HideWebContentReader)" LabelOn="@T("Web content reader is preselected")" LabelOff="@T("Web content reader is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectWebContentReader)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectWebContentReader = updatedState)" OptionHelp="@TA("When enabled, the web content reader is preselected. This might be useful when you prefer to load content from the web very often.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the content cleaner agent?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions || this.SettingsManager.ConfigurationData.TextSummarizer.HideWebContentReader)" LabelOn="@T("Content cleaner agent is preselected")" LabelOff="@T("Content cleaner agent is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the content cleaner agent is preselected. This might be useful when you prefer to clean up the content before summarizing it.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the text content cleaner?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions || this.SettingsManager.ConfigurationData.TextSummarizer.HideWebContentReader)" LabelOn="@T("Text content cleaner is preselected")" LabelOff="@T("Text content cleaner is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the text content cleaner is preselected. This might be useful when you prefer to clean up the content before summarizing it.")"/>
<ConfigurationSelect OptionDescription="@T("Preselect the target language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectedTargetLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextSummarizer.PreselectedTargetLanguage = selectedValue)" OptionHelp="@T("Which target language should be preselected?")"/>
@if (this.SettingsManager.ConfigurationData.TextSummarizer.PreselectedTargetLanguage is CommonLanguages.OTHER)
{
@@ -13,7 +13,7 @@
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect translator options?")" LabelOn="@T("Translator options are preselected")" LabelOff="@T("No translator options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Translation.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the translator options. This might be useful when you prefer a specific target language or LLM model.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the web content reader?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Translation.PreselectOptions || this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)" LabelOn="@T("Web content reader is preselected")" LabelOff="@T("Web content reader is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectWebContentReader)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Translation.PreselectWebContentReader = updatedState)" OptionHelp="@TA("When enabled, the web content reader is preselected. This might be useful when you prefer to load content from the web very often.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the content cleaner agent?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Translation.PreselectOptions || this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)" LabelOn="@T("Content cleaner agent is preselected")" LabelOff="@T("Content cleaner agent is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the content cleaner agent is preselected. This might be useful when you prefer to clean up the content before translating it.")"/>
<ConfigurationOption OptionDescription="@T("Preselect the text content cleaner?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Translation.PreselectOptions || this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)" LabelOn="@T("Text content cleaner is preselected")" LabelOff="@T("Text content cleaner is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent = updatedState)" OptionHelp="@TA("When enabled, the text content cleaner is preselected. This might be useful when you prefer to clean up the content before translating it.")"/>
<ConfigurationOption OptionDescription="@T("Preselect live translation?")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Translation.PreselectOptions)" LabelOn="@T("Live translation is preselected")" LabelOff="@T("Live translation is not preselected")" State="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectLiveTranslation)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Translation.PreselectLiveTranslation = updatedState)" />
<ConfigurationSelect OptionDescription="@T("Preselect the target language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Translation.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.Translation.PreselectedTargetLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.Translation.PreselectedTargetLanguage = selectedValue)" OptionHelp="@T("Which target language should be preselected?")"/>
@if (this.SettingsManager.ConfigurationData.Translation.PreselectedTargetLanguage is CommonLanguages.OTHER)