mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-29 17:43:38 +00:00
Resolved 29 conflicting files. The notable decisions: Confidence: main's tool-calling gate (RequiredProviderConfidence) and this branch's local-RAG gate (DataConfidenceLevel) turned out to be the same rule on the same axis, so they are now one field. Both tool results and data sources raise it through RequireProviderConfidence(). The gate checks the level strictly and no longer exempts providers trusted by configuration: TrustedProviderIds is documented as applying to data-source security checks only, and organizations set confidence through DataConfidence .CustomConfidenceScheme instead. The security axis (DataSecurity, ERI, IsTrustedForDataSourceSecurityChecks) is unchanged. Provider creation: main's CreateProvider signature won (hfEndpointKind, capabilityOverrides, no model parameter); tokenizerPath was added to it and is set for every provider, including the new Hetzner, IONOS and LiteLLM. Provider and EmbeddingProvider combine the record parameters, Lua parsing and Lua serialization of both sides. File types: main's hierarchy (ODT leaf, WORD parent, PowerPoint without the legacy .ppt, TABULAR instead of DELIMITED_TABLE) plus this branch's SPREADSHEET parent with ODS and the xlsm/xlsb/xla/xlam extensions, which the runtime already reads. Both sides had added a conflicting HTML filter; the reading family keeps the name, and the export path uses a narrow HTML_DOCUMENT, following the existing LATEX/TEX split. Runtime: main's file_data.rs is the base, including the prompt-injection sanitizer and the extraction routes. Token counting and chunk segmentation moved into take_released, so they act on the text the filter has released rather than on text it is still holding. A failed count is logged and left out instead of ending the extraction, because the app counts such a segment itself. Data sources: the participating-provider checks of this branch are kept, and main's GetAllowedDataSources overload now builds on them. DirectChatService resolves the launched chat's data source options before the check, so filter and chat see the same options. .NET and Rust both build clean; I18N regenerated to 4060 keys.
192 lines
8.6 KiB
C#
192 lines
8.6 KiB
C#
using System.Linq.Expressions;
|
|
|
|
namespace AIStudio.Settings.DataModel;
|
|
|
|
public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = null)
|
|
{
|
|
/// <summary>
|
|
/// The default constructor for the JSON deserializer.
|
|
/// </summary>
|
|
public DataApp() : this(null)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// The language behavior.
|
|
/// </summary>
|
|
public LangBehavior LanguageBehavior { get; set; } = LangBehavior.AUTO;
|
|
|
|
/// <summary>
|
|
/// The language plugin ID to use.
|
|
/// </summary>
|
|
public Guid LanguagePluginId { get; set; } = Guid.Empty;
|
|
|
|
/// <summary>
|
|
/// The preferred theme to use.
|
|
/// </summary>
|
|
public Themes PreferredTheme { get; set; } = Themes.SYSTEM;
|
|
|
|
/// <summary>
|
|
/// Should we save energy? When true, we will update content streamed
|
|
/// from the server, i.e., AI, less frequently.
|
|
/// </summary>
|
|
public bool IsSavingEnergy { get; set; } = ManagedConfiguration.Register(configSelection, n => n.IsSavingEnergy, false);
|
|
|
|
/// <summary>
|
|
/// Should we enable spellchecking for all input fields?
|
|
/// </summary>
|
|
public bool EnableSpellchecking { get; set; }
|
|
|
|
/// <summary>
|
|
/// If and when we should look for updates.
|
|
/// </summary>
|
|
public UpdateInterval UpdateInterval { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UpdateInterval, UpdateInterval.HOURLY);
|
|
|
|
/// <summary>
|
|
/// How updates should be installed.
|
|
/// </summary>
|
|
public UpdateInstallation UpdateInstallation { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UpdateInstallation, UpdateInstallation.MANUAL);
|
|
|
|
/// <summary>
|
|
/// The navigation behavior.
|
|
/// </summary>
|
|
public NavBehavior NavigationBehavior { get; set; } = NavBehavior.NEVER_EXPAND_USE_TOOLTIPS;
|
|
|
|
/// <summary>
|
|
/// Which page should be opened first when the app starts?
|
|
/// </summary>
|
|
public StartPage StartPage { get; set; } = ManagedConfiguration.Register(configSelection, n => n.StartPage, StartPage.HOME);
|
|
|
|
/// <summary>
|
|
/// Whether an alert dialog should be shown when prompt-injection content is blocked.
|
|
/// </summary>
|
|
public bool ShowPromptInjectionAlert { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowPromptInjectionAlert, true);
|
|
|
|
/// <summary>
|
|
/// Should the built-in introduction be visible on the home page?
|
|
/// </summary>
|
|
public bool ShowIntroduction { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowIntroduction, true);
|
|
|
|
/// <summary>
|
|
/// Should the quick start guide be visible on the home page?
|
|
/// </summary>
|
|
public bool ShowQuickStartGuide { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowQuickStartGuide, true);
|
|
|
|
/// <summary>
|
|
/// Should the last changelog be visible on the home page?
|
|
/// </summary>
|
|
public bool ShowLastChangelog { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowLastChangelog, true);
|
|
|
|
/// <summary>
|
|
/// Should the vision panel be visible on the home page?
|
|
/// </summary>
|
|
public bool ShowVision { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowVision, true);
|
|
|
|
/// <summary>
|
|
/// The visibility setting for previews features.
|
|
/// </summary>
|
|
public PreviewVisibility PreviewVisibility { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreviewVisibility, PreviewVisibility.NONE);
|
|
|
|
/// <summary>
|
|
/// The enabled preview features.
|
|
/// </summary>
|
|
public HashSet<PreviewFeatures> EnabledPreviewFeatures { get; set; } = ManagedConfiguration.Register(configSelection, n => n.EnabledPreviewFeatures, []);
|
|
|
|
/// <summary>
|
|
/// Should we preselect a provider for the entire app?
|
|
/// </summary>
|
|
public string PreselectedProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreselectedProvider, string.Empty);
|
|
|
|
/// <summary>
|
|
/// Should we preselect a profile for the entire app?
|
|
/// </summary>
|
|
public string PreselectedProfile { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreselectedProfile, string.Empty);
|
|
|
|
/// <summary>
|
|
/// Should we preselect a chat template for the entire app?
|
|
/// </summary>
|
|
public string PreselectedChatTemplate { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Which transcription provider should be used?
|
|
/// </summary>
|
|
public string UseTranscriptionProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UseTranscriptionProvider, string.Empty);
|
|
|
|
/// <summary>
|
|
/// The global keyboard shortcut for toggling voice recording.
|
|
/// Uses Tauri's shortcut format, e.g., "CmdOrControl+1" (Cmd+1 on macOS, Ctrl+1 on Windows/Linux).
|
|
/// Set to empty string to disable the global shortcut.
|
|
/// </summary>
|
|
public string ShortcutVoiceRecording { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShortcutVoiceRecording, string.Empty);
|
|
|
|
/// <summary>
|
|
/// The user-facing label for the voice recording shortcut, based on the user's keyboard layout.
|
|
/// </summary>
|
|
public string ShortcutVoiceRecordingDisplayName { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The canonical voice recording shortcut value this display label belongs to.
|
|
/// </summary>
|
|
public string ShortcutVoiceRecordingDisplaySource { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The HTTP timeout in seconds for external HTTP clients.
|
|
/// </summary>
|
|
public int HttpClientTimeoutSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HttpClientTimeoutSeconds, ExternalHttpClientTimeout.DEFAULT_HTTP_CLIENT_TIMEOUT_SECONDS);
|
|
|
|
/// <summary>
|
|
/// Should external HTTP clients trust additional root certificates from a configured PEM bundle?
|
|
/// </summary>
|
|
public bool ExternalHttpCustomRootCertificatesEnabled { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificatesEnabled, false);
|
|
|
|
/// <summary>
|
|
/// Path to a PEM bundle containing additional root certificates for external HTTP clients.
|
|
/// </summary>
|
|
public string ExternalHttpCustomRootCertificateBundlePath { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificateBundlePath, string.Empty);
|
|
|
|
/// <summary>
|
|
/// Hostnames for which external HTTP clients may use the additional root certificates.
|
|
/// </summary>
|
|
public HashSet<string> ExternalHttpCustomRootCertificateAllowedHosts { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificateAllowedHosts, []);
|
|
|
|
/// <summary>
|
|
/// Should the user be allowed to add providers?
|
|
/// </summary>
|
|
public bool AllowUserToAddProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddProvider, true);
|
|
|
|
/// <summary>
|
|
/// Should the user be allowed to import plugin archives from disk?
|
|
/// </summary>
|
|
public bool AllowUserToImportPlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToImportPlugins, true);
|
|
|
|
/// <summary>
|
|
/// Should the user be allowed to import configuration plugin archives from disk?
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is a second gate on top of AllowUserToImportPlugins, and both must allow the import.
|
|
/// Configuration plugins deserve their own switch because they are far more powerful than an
|
|
/// assistant: they define LLM providers and data sources, and they lock settings.
|
|
/// </remarks>
|
|
public bool AllowUserToImportConfigurationPlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToImportConfigurationPlugins, true);
|
|
|
|
/// <summary>
|
|
/// Should the user be allowed to share or export plugins as archives?
|
|
/// </summary>
|
|
public bool AllowUserToSharePlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToSharePlugins, true);
|
|
|
|
/// <summary>
|
|
/// Should administration settings be visible in the UI?
|
|
/// </summary>
|
|
public bool ShowAdminSettings { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowAdminSettings, false);
|
|
|
|
/// <summary>
|
|
/// Settings for indexing local data sources.
|
|
/// </summary>
|
|
public DataDataSourceIndexing DataSourceIndexing { get; init; } = new();
|
|
|
|
/// <summary>
|
|
/// List of assistants that should be hidden from the UI.
|
|
/// </summary>
|
|
public HashSet<ConfigurableAssistant> HiddenAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HiddenAssistants, []);
|
|
}
|