mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 11:41:38 +00:00
Added an option to hide specific assistants (#625)
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (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) (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 deb updater) (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 updater) (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) (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 deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (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) (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 deb updater) (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 updater) (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) (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 deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ab7618097d
commit
4f8266f255
37
CLAUDE.md
37
CLAUDE.md
@ -13,7 +13,7 @@ MindWork AI Studio is a cross-platform desktop application for interacting with
|
|||||||
- **Providers:** Multi-provider architecture supporting OpenAI, Anthropic, Google, Mistral, Perplexity, self-hosted models, and others
|
- **Providers:** Multi-provider architecture supporting OpenAI, Anthropic, Google, Mistral, Perplexity, self-hosted models, and others
|
||||||
- **Plugin System:** Lua-based plugin system for language packs, configuration, and future assistant plugins
|
- **Plugin System:** Lua-based plugin system for language packs, configuration, and future assistant plugins
|
||||||
|
|
||||||
## Building and Running
|
## Building
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
- .NET 9 SDK
|
- .NET 9 SDK
|
||||||
@ -22,39 +22,16 @@ MindWork AI Studio is a cross-platform desktop application for interacting with
|
|||||||
- Tauri prerequisites (platform-specific dependencies)
|
- Tauri prerequisites (platform-specific dependencies)
|
||||||
- **Note:** Development on Linux is discouraged due to complex Tauri dependencies that vary by distribution
|
- **Note:** Development on Linux is discouraged due to complex Tauri dependencies that vary by distribution
|
||||||
|
|
||||||
### One-Time Setup
|
### Build
|
||||||
```bash
|
```bash
|
||||||
cd app/Build
|
cd app/Build
|
||||||
dotnet run build
|
dotnet run build
|
||||||
```
|
```
|
||||||
This builds the .NET app as a Tauri "sidecar" binary, which is required even for development.
|
This builds the .NET app as a Tauri "sidecar" binary, which is required even for development.
|
||||||
|
|
||||||
### Development Workflow
|
|
||||||
Run these commands in separate terminals:
|
|
||||||
|
|
||||||
**Terminal 1 - Start Rust runtime:**
|
|
||||||
```bash
|
|
||||||
cd runtime
|
|
||||||
cargo tauri dev --no-watch
|
|
||||||
```
|
|
||||||
|
|
||||||
**Terminal 2 - Start .NET app:**
|
|
||||||
```bash
|
|
||||||
cd "app/MindWork AI Studio"
|
|
||||||
dotnet run
|
|
||||||
```
|
|
||||||
|
|
||||||
The app will start in the Tauri window. Hot reload is supported for .NET code changes.
|
|
||||||
|
|
||||||
### Building for Production
|
|
||||||
```bash
|
|
||||||
cd app/Build
|
|
||||||
dotnet run build
|
|
||||||
```
|
|
||||||
Creates a release build for the current platform and architecture. Output is in `runtime/target/release/`.
|
|
||||||
|
|
||||||
### Running Tests
|
### Running Tests
|
||||||
Currently no automated test suite exists in the repository.
|
Currently, no automated test suite exists in the repository.
|
||||||
|
|
||||||
## Architecture Details
|
## Architecture Details
|
||||||
|
|
||||||
@ -125,6 +102,14 @@ Plugins can configure:
|
|||||||
- Preview features visibility
|
- Preview features visibility
|
||||||
- Preselected profiles
|
- Preselected profiles
|
||||||
- Chat templates
|
- Chat templates
|
||||||
|
- etc.
|
||||||
|
|
||||||
|
When adding configuration options, update:
|
||||||
|
- `app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs`: In method `TryProcessConfiguration` register new options.
|
||||||
|
- `app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs`: In method `LoadAll` check for leftover configuration.
|
||||||
|
- The corresponding data class in `app/MindWork AI Studio/Settings/DataModel/` to call `ManagedConfiguration.Register(...)`, when adding config options (in contrast to complex config. objects)
|
||||||
|
- `app/MindWork AI Studio/Tools/PluginSystem/PluginConfigurationObject.cs` for parsing logic of complex configuration objects.
|
||||||
|
- `app/MindWork AI Studio/Plugins/configuration/plugin.lua` to document the new configuration option.
|
||||||
|
|
||||||
## RAG (Retrieval-Augmented Generation)
|
## RAG (Retrieval-Augmented Generation)
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
@inherits MSGComponentBase
|
@inherits MSGComponentBase
|
||||||
@typeparam TSettings
|
@typeparam TSettings
|
||||||
|
|
||||||
|
@if (this.IsVisible)
|
||||||
|
{
|
||||||
<MudCard Outlined="@true" Style="@this.BlockStyle">
|
<MudCard Outlined="@true" Style="@this.BlockStyle">
|
||||||
<MudCardHeader>
|
<MudCardHeader>
|
||||||
<CardHeaderContent>
|
<CardHeaderContent>
|
||||||
@ -28,3 +30,4 @@
|
|||||||
</MudButtonGroup>
|
</MudButtonGroup>
|
||||||
</MudCardActions>
|
</MudCardActions>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
using AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
||||||
@ -21,6 +23,12 @@ public partial class AssistantBlock<TSettings> : MSGComponentBase where TSetting
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public string Link { get; set; } = string.Empty;
|
public string Link { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public Tools.Components Component { get; set; } = Tools.Components.NONE;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public PreviewFeatures RequiredPreviewFeature { get; set; } = PreviewFeatures.NONE;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
private MudTheme ColorTheme { get; init; } = null!;
|
private MudTheme ColorTheme { get; init; } = null!;
|
||||||
|
|
||||||
@ -41,4 +49,6 @@ public partial class AssistantBlock<TSettings> : MSGComponentBase where TSetting
|
|||||||
};
|
};
|
||||||
|
|
||||||
private string BlockStyle => $"border-width: 2px; border-color: {this.BorderColor}; border-radius: 12px; border-style: solid; max-width: 20em;";
|
private string BlockStyle => $"border-width: 2px; border-color: {this.BorderColor}; border-radius: 12px; border-style: solid; max-width: 20em;";
|
||||||
|
|
||||||
|
private bool IsVisible => this.SettingsManager.IsAssistantVisible(this.Component, assistantName: this.Name, requiredPreviewFeature: this.RequiredPreviewFeature);
|
||||||
}
|
}
|
||||||
@ -10,59 +10,87 @@
|
|||||||
|
|
||||||
<InnerScrolling>
|
<InnerScrolling>
|
||||||
|
|
||||||
|
@if (this.SettingsManager.IsAnyCategoryAssistantVisible("General",
|
||||||
|
(Components.TEXT_SUMMARIZER_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.TRANSLATION_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.GRAMMAR_SPELLING_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.REWRITE_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.SYNONYMS_ASSISTANT, PreviewFeatures.NONE)
|
||||||
|
))
|
||||||
|
{
|
||||||
<MudText Typo="Typo.h4" Class="mb-2 mr-3">
|
<MudText Typo="Typo.h4" Class="mb-2 mr-3">
|
||||||
@T("General")
|
@T("General")
|
||||||
</MudText>
|
</MudText>
|
||||||
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogTextSummarizer" Component="Components.TEXT_SUMMARIZER_ASSISTANT" Name="@T("Text Summarizer")" Description="@T("Use an LLM to summarize a given text.")" Icon="@Icons.Material.Filled.TextSnippet" Link="@Routes.ASSISTANT_SUMMARIZER"/>
|
||||||
<AssistantBlock TSettings="SettingsDialogTranslation" Name="@T("Translation")" Description="@T("Translate text into another language.")" Icon="@Icons.Material.Filled.Translate" Link="@Routes.ASSISTANT_TRANSLATION"/>
|
<AssistantBlock TSettings="SettingsDialogTranslation" Component="Components.TRANSLATION_ASSISTANT" Name="@T("Translation")" Description="@T("Translate text into another language.")" Icon="@Icons.Material.Filled.Translate" Link="@Routes.ASSISTANT_TRANSLATION"/>
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogGrammarSpelling" Component="Components.GRAMMAR_SPELLING_ASSISTANT" Name="@T("Grammar & Spelling")" Description="@T("Check grammar and spelling of a given text.")" Icon="@Icons.Material.Filled.Edit" Link="@Routes.ASSISTANT_GRAMMAR_SPELLING"/>
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogRewrite" Component="Components.REWRITE_ASSISTANT" 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"/>
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogSynonyms" Component="Components.SYNONYMS_ASSISTANT" Name="@T("Synonyms")" Description="@T("Find synonyms for a given word or phrase.")" Icon="@Icons.Material.Filled.Spellcheck" Link="@Routes.ASSISTANT_SYNONYMS"/>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (this.SettingsManager.IsAnyCategoryAssistantVisible("Business",
|
||||||
|
(Components.EMAIL_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.DOCUMENT_ANALYSIS_ASSISTANT, PreviewFeatures.PRE_DOCUMENT_ANALYSIS_2025),
|
||||||
|
(Components.MY_TASKS_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.AGENDA_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.JOB_POSTING_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.LEGAL_CHECK_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.ICON_FINDER_ASSISTANT, PreviewFeatures.NONE)
|
||||||
|
))
|
||||||
|
{
|
||||||
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
||||||
@T("Business")
|
@T("Business")
|
||||||
</MudText>
|
</MudText>
|
||||||
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogWritingEMails" Component="Components.EMAIL_ASSISTANT" Name="@T("E-Mail")" Description="@T("Generate an e-mail for a given context.")" Icon="@Icons.Material.Filled.Email" Link="@Routes.ASSISTANT_EMAIL"/>
|
||||||
|
<AssistantBlock TSettings="SettingsDialogDocumentAnalysis" Component="Components.DOCUMENT_ANALYSIS_ASSISTANT" RequiredPreviewFeature="PreviewFeatures.PRE_DOCUMENT_ANALYSIS_2025" 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 (PreviewFeatures.PRE_DOCUMENT_ANALYSIS_2025.IsEnabled(this.SettingsManager))
|
<AssistantBlock TSettings="SettingsDialogMyTasks" Component="Components.MY_TASKS_ASSISTANT" 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"/>
|
||||||
{
|
<AssistantBlock TSettings="SettingsDialogAgenda" Component="Components.AGENDA_ASSISTANT" Name="@T("Agenda Planner")" Description="@T("Generate an agenda for a given meeting, seminar, etc.")" Icon="@Icons.Material.Filled.CalendarToday" Link="@Routes.ASSISTANT_AGENDA"/>
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogJobPostings" Component="Components.JOB_POSTING_ASSISTANT" 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"/>
|
||||||
|
<AssistantBlock TSettings="SettingsDialogLegalCheck" Component="Components.LEGAL_CHECK_ASSISTANT" Name="@T("Legal Check")" Description="@T("Ask a question about a legal document.")" Icon="@Icons.Material.Filled.Gavel" Link="@Routes.ASSISTANT_LEGAL_CHECK"/>
|
||||||
|
<AssistantBlock TSettings="SettingsDialogIconFinder" Component="Components.ICON_FINDER_ASSISTANT" 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>
|
||||||
}
|
}
|
||||||
|
|
||||||
<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 (this.SettingsManager.IsAnyCategoryAssistantVisible("Learning",
|
||||||
<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"/>
|
(Components.BIAS_DAY_ASSISTANT, PreviewFeatures.NONE)
|
||||||
<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"/>
|
))
|
||||||
<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"/>
|
{
|
||||||
<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">
|
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
||||||
@T("Learning")
|
@T("Learning")
|
||||||
</MudText>
|
</MudText>
|
||||||
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogAssistantBias" Component="Components.BIAS_DAY_ASSISTANT" 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>
|
</MudStack>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (this.SettingsManager.IsAnyCategoryAssistantVisible("Software Engineering",
|
||||||
|
(Components.CODING_ASSISTANT, PreviewFeatures.NONE),
|
||||||
|
(Components.ERI_ASSISTANT, PreviewFeatures.PRE_RAG_2024)
|
||||||
|
))
|
||||||
|
{
|
||||||
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
||||||
@T("Software Engineering")
|
@T("Software Engineering")
|
||||||
</MudText>
|
</MudText>
|
||||||
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogCoding" Component="Components.CODING_ASSISTANT" 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))
|
<AssistantBlock TSettings="SettingsDialogERIServer" Component="Components.ERI_ASSISTANT" RequiredPreviewFeature="PreviewFeatures.PRE_RAG_2024" Name="@T("ERI Server")" Description="@T("Generate an ERI server to integrate business systems.")" Icon="@Icons.Material.Filled.PrivateConnectivity" Link="@Routes.ASSISTANT_ERI"/>
|
||||||
{
|
|
||||||
<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>
|
</MudStack>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (this.SettingsManager.IsAnyCategoryAssistantVisible("AI Studio Development",
|
||||||
|
(Components.I18N_ASSISTANT, PreviewFeatures.NONE)
|
||||||
|
))
|
||||||
|
{
|
||||||
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
|
||||||
@T("AI Studio Development")
|
@T("AI Studio Development")
|
||||||
</MudText>
|
</MudText>
|
||||||
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
<MudStack Row="@true" Wrap="@Wrap.Wrap" Class="mb-3">
|
||||||
<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"/>
|
<AssistantBlock TSettings="SettingsDialogI18N" Component="Components.I18N_ASSISTANT" 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>
|
</MudStack>
|
||||||
|
}
|
||||||
|
|
||||||
</InnerScrolling>
|
</InnerScrolling>
|
||||||
</div>
|
</div>
|
||||||
@ -143,6 +143,16 @@ CONFIG["SETTINGS"] = {}
|
|||||||
-- Please note: using an empty string ("") will lock the selection and disable dictation/transcription.
|
-- Please note: using an empty string ("") will lock the selection and disable dictation/transcription.
|
||||||
-- CONFIG["SETTINGS"]["DataApp.UseTranscriptionProvider"] = "00000000-0000-0000-0000-000000000000"
|
-- CONFIG["SETTINGS"]["DataApp.UseTranscriptionProvider"] = "00000000-0000-0000-0000-000000000000"
|
||||||
|
|
||||||
|
-- Configure which assistants should be hidden from the UI.
|
||||||
|
-- Allowed values are:
|
||||||
|
-- GRAMMAR_SPELLING_ASSISTANT, ICON_FINDER_ASSISTANT, REWRITE_ASSISTANT,
|
||||||
|
-- TRANSLATION_ASSISTANT, AGENDA_ASSISTANT, CODING_ASSISTANT,
|
||||||
|
-- TEXT_SUMMARIZER_ASSISTANT, EMAIL_ASSISTANT, LEGAL_CHECK_ASSISTANT,
|
||||||
|
-- SYNONYMS_ASSISTANT, MY_TASKS_ASSISTANT, JOB_POSTING_ASSISTANT,
|
||||||
|
-- BIAS_DAY_ASSISTANT, ERI_ASSISTANT, DOCUMENT_ANALYSIS_ASSISTANT,
|
||||||
|
-- I18N_ASSISTANT
|
||||||
|
-- CONFIG["SETTINGS"]["DataApp.HiddenAssistants"] = { "ERI_ASSISTANT", "I18N_ASSISTANT" }
|
||||||
|
|
||||||
-- Example chat templates for this configuration:
|
-- Example chat templates for this configuration:
|
||||||
CONFIG["CHAT_TEMPLATES"] = {}
|
CONFIG["CHAT_TEMPLATES"] = {}
|
||||||
|
|
||||||
|
|||||||
30
app/MindWork AI Studio/Settings/ConfigurableAssistant.cs
Normal file
30
app/MindWork AI Studio/Settings/ConfigurableAssistant.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
namespace AIStudio.Settings;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum representing assistants that can be hidden via configuration plugin.
|
||||||
|
/// </summary>
|
||||||
|
public enum ConfigurableAssistant
|
||||||
|
{
|
||||||
|
NONE = 0,
|
||||||
|
UNKNOWN = 1,
|
||||||
|
|
||||||
|
GRAMMAR_SPELLING_ASSISTANT,
|
||||||
|
ICON_FINDER_ASSISTANT,
|
||||||
|
REWRITE_ASSISTANT,
|
||||||
|
TRANSLATION_ASSISTANT,
|
||||||
|
AGENDA_ASSISTANT,
|
||||||
|
CODING_ASSISTANT,
|
||||||
|
TEXT_SUMMARIZER_ASSISTANT,
|
||||||
|
EMAIL_ASSISTANT,
|
||||||
|
LEGAL_CHECK_ASSISTANT,
|
||||||
|
SYNONYMS_ASSISTANT,
|
||||||
|
MY_TASKS_ASSISTANT,
|
||||||
|
JOB_POSTING_ASSISTANT,
|
||||||
|
BIAS_DAY_ASSISTANT,
|
||||||
|
ERI_ASSISTANT,
|
||||||
|
DOCUMENT_ANALYSIS_ASSISTANT,
|
||||||
|
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
|
I18N_ASSISTANT,
|
||||||
|
// ReSharper restore InconsistentNaming
|
||||||
|
}
|
||||||
@ -86,4 +86,9 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
|
|||||||
/// Should the user be allowed to add providers?
|
/// Should the user be allowed to add providers?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool AllowUserToAddProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddProvider, true);
|
public bool AllowUserToAddProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddProvider, true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of assistants that should be hidden from the UI.
|
||||||
|
/// </summary>
|
||||||
|
public HashSet<ConfigurableAssistant> HiddenAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HiddenAssistants, []);
|
||||||
}
|
}
|
||||||
@ -2,6 +2,8 @@ namespace AIStudio.Settings.DataModel;
|
|||||||
|
|
||||||
public enum PreviewFeatures
|
public enum PreviewFeatures
|
||||||
{
|
{
|
||||||
|
NONE = 0,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Important: Never delete any enum value from this list.
|
// Important: Never delete any enum value from this list.
|
||||||
// We must be able to deserialize old settings files that may contain these values.
|
// We must be able to deserialize old settings files that may contain these values.
|
||||||
|
|||||||
100
app/MindWork AI Studio/Tools/AssistantVisibilityExtensions.cs
Normal file
100
app/MindWork AI Studio/Tools/AssistantVisibilityExtensions.cs
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
using AIStudio.Settings;
|
||||||
|
using AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
|
namespace AIStudio.Tools;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extension methods for checking assistant visibility based on configuration and preview features.
|
||||||
|
/// </summary>
|
||||||
|
public static class AssistantVisibilityExtensions
|
||||||
|
{
|
||||||
|
private static readonly ILogger LOGGER = Program.LOGGER_FACTORY.CreateLogger(nameof(AssistantVisibilityExtensions));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if an assistant should be visible based on configuration and optional preview feature requirements.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settingsManager">The settings manager to check configuration against.</param>
|
||||||
|
/// <param name="withLogging">Whether to log visibility decisions.</param>
|
||||||
|
/// <param name="assistantName">The name of the assistant to check (for logging purposes).</param>
|
||||||
|
/// <param name="component">The assistant component to check.</param>
|
||||||
|
/// <param name="requiredPreviewFeature">Optional preview feature that must be enabled for the assistant to be visible.</param>
|
||||||
|
/// <returns>True if the assistant should be visible, false otherwise.</returns>
|
||||||
|
public static bool IsAssistantVisible(this SettingsManager settingsManager, Components component, bool withLogging = true, string assistantName = "", PreviewFeatures requiredPreviewFeature = PreviewFeatures.NONE)
|
||||||
|
{
|
||||||
|
withLogging = withLogging && !string.IsNullOrWhiteSpace(assistantName);
|
||||||
|
|
||||||
|
// Check if a preview feature is required and enabled:
|
||||||
|
if (requiredPreviewFeature != PreviewFeatures.NONE && !requiredPreviewFeature.IsEnabled(settingsManager))
|
||||||
|
{
|
||||||
|
if(withLogging)
|
||||||
|
LOGGER.LogInformation("Assistant '{AssistantName}' is not visible because the required preview feature '{PreviewFeature}' is not enabled.", assistantName, requiredPreviewFeature);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no component is specified, it's always visible:
|
||||||
|
if (component is Components.NONE)
|
||||||
|
{
|
||||||
|
if(withLogging)
|
||||||
|
LOGGER.LogWarning("Assistant '{AssistantName}' is visible because no component is specified.", assistantName);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map Components enum to ConfigurableAssistant enum:
|
||||||
|
var configurableAssistant = component switch
|
||||||
|
{
|
||||||
|
Components.GRAMMAR_SPELLING_ASSISTANT => ConfigurableAssistant.GRAMMAR_SPELLING_ASSISTANT,
|
||||||
|
Components.ICON_FINDER_ASSISTANT => ConfigurableAssistant.ICON_FINDER_ASSISTANT,
|
||||||
|
Components.REWRITE_ASSISTANT => ConfigurableAssistant.REWRITE_ASSISTANT,
|
||||||
|
Components.TRANSLATION_ASSISTANT => ConfigurableAssistant.TRANSLATION_ASSISTANT,
|
||||||
|
Components.AGENDA_ASSISTANT => ConfigurableAssistant.AGENDA_ASSISTANT,
|
||||||
|
Components.CODING_ASSISTANT => ConfigurableAssistant.CODING_ASSISTANT,
|
||||||
|
Components.TEXT_SUMMARIZER_ASSISTANT => ConfigurableAssistant.TEXT_SUMMARIZER_ASSISTANT,
|
||||||
|
Components.EMAIL_ASSISTANT => ConfigurableAssistant.EMAIL_ASSISTANT,
|
||||||
|
Components.LEGAL_CHECK_ASSISTANT => ConfigurableAssistant.LEGAL_CHECK_ASSISTANT,
|
||||||
|
Components.SYNONYMS_ASSISTANT => ConfigurableAssistant.SYNONYMS_ASSISTANT,
|
||||||
|
Components.MY_TASKS_ASSISTANT => ConfigurableAssistant.MY_TASKS_ASSISTANT,
|
||||||
|
Components.JOB_POSTING_ASSISTANT => ConfigurableAssistant.JOB_POSTING_ASSISTANT,
|
||||||
|
Components.BIAS_DAY_ASSISTANT => ConfigurableAssistant.BIAS_DAY_ASSISTANT,
|
||||||
|
Components.ERI_ASSISTANT => ConfigurableAssistant.ERI_ASSISTANT,
|
||||||
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => ConfigurableAssistant.DOCUMENT_ANALYSIS_ASSISTANT,
|
||||||
|
Components.I18N_ASSISTANT => ConfigurableAssistant.I18N_ASSISTANT,
|
||||||
|
|
||||||
|
_ => ConfigurableAssistant.UNKNOWN,
|
||||||
|
};
|
||||||
|
|
||||||
|
// If the component doesn't map to a configurable assistant, it's always visible:
|
||||||
|
if (configurableAssistant is ConfigurableAssistant.UNKNOWN)
|
||||||
|
{
|
||||||
|
if(withLogging)
|
||||||
|
LOGGER.LogWarning("Assistant '{AssistantName}' is visible because its component '{Component}' does not map to a configurable assistant.", assistantName, component);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the assistant is hidden by any configuration plugin:
|
||||||
|
var isHidden = settingsManager.ConfigurationData.App.HiddenAssistants.Contains(configurableAssistant);
|
||||||
|
if (isHidden && withLogging)
|
||||||
|
LOGGER.LogInformation("Assistant '{AssistantName}' is hidden based on the configuration.", assistantName);
|
||||||
|
|
||||||
|
return !isHidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if any assistant in a category should be visible.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settingsManager">The settings manager to check configuration against.</param>
|
||||||
|
/// <param name="categoryName">The name of the assistant category (for logging purposes).</param>
|
||||||
|
/// <param name="assistants">The assistants in the category with their optional preview feature requirements.</param>
|
||||||
|
/// <returns>True if at least one assistant in the category should be visible, false otherwise.</returns>
|
||||||
|
public static bool IsAnyCategoryAssistantVisible(this SettingsManager settingsManager, string categoryName, params (Components Component, PreviewFeatures RequiredPreviewFeature)[] assistants)
|
||||||
|
{
|
||||||
|
foreach (var (component, requiredPreviewFeature) in assistants)
|
||||||
|
if (settingsManager.IsAssistantVisible(component, withLogging: false, requiredPreviewFeature: requiredPreviewFeature))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
LOGGER.LogInformation("No assistants in category '{CategoryName}' are visible.", categoryName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -67,6 +67,9 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
|||||||
// Config: enabled preview features
|
// Config: enabled preview features
|
||||||
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.EnabledPreviewFeatures, this.Id, settingsTable, dryRun);
|
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.EnabledPreviewFeatures, this.Id, settingsTable, dryRun);
|
||||||
|
|
||||||
|
// Config: hide some assistants?
|
||||||
|
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.HiddenAssistants, this.Id, settingsTable, dryRun);
|
||||||
|
|
||||||
// Handle configured LLM providers:
|
// Handle configured LLM providers:
|
||||||
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun);
|
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun);
|
||||||
|
|
||||||
|
|||||||
@ -177,6 +177,10 @@ public static partial class PluginFactory
|
|||||||
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.UseTranscriptionProvider, AVAILABLE_PLUGINS))
|
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.UseTranscriptionProvider, AVAILABLE_PLUGINS))
|
||||||
wasConfigurationChanged = true;
|
wasConfigurationChanged = true;
|
||||||
|
|
||||||
|
// Check for hidden assistants:
|
||||||
|
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.HiddenAssistants, AVAILABLE_PLUGINS))
|
||||||
|
wasConfigurationChanged = true;
|
||||||
|
|
||||||
if (wasConfigurationChanged)
|
if (wasConfigurationChanged)
|
||||||
{
|
{
|
||||||
await SETTINGS_MANAGER.StoreSettings();
|
await SETTINGS_MANAGER.StoreSettings();
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
# v26.1.2, build 232 (2026-01-xx xx:xx UTC)
|
# v26.1.2, build 232 (2026-01-xx xx:xx UTC)
|
||||||
|
- Added the option to hide specific assistants by configuration plugins. This is useful for enterprise environments in organizations.
|
||||||
Loading…
Reference in New Issue
Block a user