AI-Studio/app/MindWork AI Studio/Pages/Assistants.razor
Claude 509d57f69a
Add config plugin support to hide individual assistants
This change enables enterprise IT departments to hide specific assistants
via configuration plugins, providing better control over which features
are available to end users.

Changes:
- Created ConfigurableAssistant enum listing all hideable assistants
- Added HiddenAssistants property to DataApp settings (HashSet<ConfigurableAssistant>)
- Added IsAssistantVisible() method in Assistants.razor.cs to check visibility
- Updated Assistants.razor to conditionally render assistants based on configuration
- Extended plugin.lua template with HiddenAssistants configuration example

Example usage in configuration plugin:
CONFIG["SETTINGS"]["DataApp.HiddenAssistants"] = { "GRAMMAR_SPELLING_ASSISTANT", "SYNONYMS_ASSISTANT" }

The setting integrates with the existing ManagedConfiguration system and
is locked when managed by a config plugin, preventing user override.
2026-01-11 22:18:26 +00:00

110 lines
6.6 KiB
Plaintext

@using AIStudio.Dialogs.Settings
@using AIStudio.Settings.DataModel
@attribute [Route(Routes.ASSISTANTS)]
@inherits MSGComponentBase
<div class="inner-scrolling-context">
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
@T("Assistants")
</MudText>
<InnerScrolling>
<MudText Typo="Typo.h4" Class="mb-2 mr-3">
@T("General")
</MudText>
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
@if (IsAssistantVisible(Components.TEXT_SUMMARIZER_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogTextSummarizer" Name="@T("Text Summarizer")" Description="@T("Use an LLM to summarize a given text.")" Icon="@Icons.Material.Filled.TextSnippet" Link="@Routes.ASSISTANT_SUMMARIZER"/>
}
@if (IsAssistantVisible(Components.TRANSLATION_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogTranslation" Name="@T("Translation")" Description="@T("Translate text into another language.")" Icon="@Icons.Material.Filled.Translate" Link="@Routes.ASSISTANT_TRANSLATION"/>
}
@if (IsAssistantVisible(Components.GRAMMAR_SPELLING_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogGrammarSpelling" Name="@T("Grammar & Spelling")" Description="@T("Check grammar and spelling of a given text.")" Icon="@Icons.Material.Filled.Edit" Link="@Routes.ASSISTANT_GRAMMAR_SPELLING"/>
}
@if (IsAssistantVisible(Components.REWRITE_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogRewrite" Name="@T("Rewrite & Improve")" Description="@T("Rewrite and improve a given text for a chosen style.")" Icon="@Icons.Material.Filled.Edit" Link="@Routes.ASSISTANT_REWRITE"/>
}
@if (IsAssistantVisible(Components.SYNONYMS_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogSynonyms" Name="@T("Synonyms")" Description="@T("Find synonyms for a given word or phrase.")" Icon="@Icons.Material.Filled.Spellcheck" Link="@Routes.ASSISTANT_SYNONYMS"/>
}
</MudStack>
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
@T("Business")
</MudText>
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
@if (IsAssistantVisible(Components.EMAIL_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogWritingEMails" Name="@T("E-Mail")" Description="@T("Generate an e-mail for a given context.")" Icon="@Icons.Material.Filled.Email" Link="@Routes.ASSISTANT_EMAIL"/>
}
@if (PreviewFeatures.PRE_DOCUMENT_ANALYSIS_2025.IsEnabled(this.SettingsManager) && IsAssistantVisible(Components.DOCUMENT_ANALYSIS_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogDocumentAnalysis" Name="@T("Document Analysis")" Description="@T("Analyze a document regarding defined rules and extract key information.")" Icon="@Icons.Material.Filled.DocumentScanner" Link="@Routes.ASSISTANT_DOCUMENT_ANALYSIS"/>
}
@if (IsAssistantVisible(Components.MY_TASKS_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogMyTasks" Name="@T("My Tasks")" Description="@T("Analyze a text or an email for tasks you need to complete.")" Icon="@Icons.Material.Filled.Task" Link="@Routes.ASSISTANT_MY_TASKS"/>
}
@if (IsAssistantVisible(Components.AGENDA_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogAgenda" Name="@T("Agenda Planner")" Description="@T("Generate an agenda for a given meeting, seminar, etc.")" Icon="@Icons.Material.Filled.CalendarToday" Link="@Routes.ASSISTANT_AGENDA"/>
}
@if (IsAssistantVisible(Components.JOB_POSTING_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogJobPostings" Name="@T("Job Posting")" Description="@T("Generate a job posting for a given job description.")" Icon="@Icons.Material.Filled.Work" Link="@Routes.ASSISTANT_JOB_POSTING"/>
}
@if (IsAssistantVisible(Components.LEGAL_CHECK_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogLegalCheck" Name="@T("Legal Check")" Description="@T("Ask a question about a legal document.")" Icon="@Icons.Material.Filled.Gavel" Link="@Routes.ASSISTANT_LEGAL_CHECK"/>
}
@if (IsAssistantVisible(Components.ICON_FINDER_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogIconFinder" Name="@T("Icon Finder")" Description="@T("Use an LLM to find an icon for a given context.")" Icon="@Icons.Material.Filled.FindInPage" Link="@Routes.ASSISTANT_ICON_FINDER"/>
}
</MudStack>
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
@T("Learning")
</MudText>
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
@if (IsAssistantVisible(Components.BIAS_DAY_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogAssistantBias" Name="@T("Bias of the Day")" Description="@T("Learn about one cognitive bias every day.")" Icon="@Icons.Material.Filled.Psychology" Link="@Routes.ASSISTANT_BIAS"/>
}
</MudStack>
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
@T("Software Engineering")
</MudText>
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
@if (IsAssistantVisible(Components.CODING_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogCoding" Name="@T("Coding")" Description="@T("Get coding and debugging support from an LLM.")" Icon="@Icons.Material.Filled.Code" Link="@Routes.ASSISTANT_CODING"/>
}
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager) && IsAssistantVisible(Components.ERI_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogERIServer" Name="@T("ERI Server")" Description="@T("Generate an ERI server to integrate business systems.")" Icon="@Icons.Material.Filled.PrivateConnectivity" Link="@Routes.ASSISTANT_ERI"/>
}
</MudStack>
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
@T("AI Studio Development")
</MudText>
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
@if (IsAssistantVisible(Components.I18N_ASSISTANT))
{
<AssistantBlock TSettings="SettingsDialogI18N" Name="@T("Localization")" Description="@T("Translate AI Studio text content into other languages")" Icon="@Icons.Material.Filled.Translate" Link="@Routes.ASSISTANT_AI_STUDIO_I18N"/>
}
</MudStack>
</InnerScrolling>
</div>