Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ece7801
Rename GenerateUriAsync to GenerateArchiveUriAsync
SommerEngineering May 29, 2025
957d596
Updated pandoc versions
SommerEngineering May 29, 2025
7ec2b19
Spelling
SommerEngineering May 29, 2025
40b6432
Formatting
SommerEngineering May 29, 2025
d2a6223
Refactored Pandoc architecture handling with RID-based logic
SommerEngineering May 29, 2025
0a94d03
Formatting
SommerEngineering May 29, 2025
de8c6bb
Spelling
SommerEngineering May 29, 2025
04db158
Simplify directory deletion
SommerEngineering May 29, 2025
5287b28
Refactored pandoc executable name to use a property
SommerEngineering May 29, 2025
e0c29d4
Fixed Pandoc executable assumption
SommerEngineering May 29, 2025
615730d
Update logger name from 'PandocService' to 'Pandoc'
SommerEngineering May 29, 2025
ca8b3a1
Formatting
SommerEngineering May 29, 2025
8adc138
Fixed exception handling
SommerEngineering May 29, 2025
4514c23
Spelling
SommerEngineering May 29, 2025
70d0b28
Formatting
SommerEngineering May 29, 2025
a31b3ff
Simplified availability check
SommerEngineering May 29, 2025
7dcb941
Refactored the Pandoc process setup and improved the executable path …
SommerEngineering May 29, 2025
1de9e19
Formatting
SommerEngineering May 29, 2025
4c09c43
Refactored Pandoc handling with improved process abstractions
SommerEngineering May 29, 2025
f4cac63
Seal PandocPreparedProcess class definition
SommerEngineering May 29, 2025
bb1ce9f
Refactor Pandoc process setup using a dedicated builder class
SommerEngineering May 29, 2025
4f8dfc5
Add Pandoc version and installation support
SommerEngineering May 29, 2025
0a4bb85
Switch to use IsNullOrWhiteSpace
SommerEngineering May 29, 2025
53a3d05
Add MaxHeight and ExpandedChanged parameters to expansion panel
SommerEngineering May 29, 2025
2c11619
Made text justified
SommerEngineering May 29, 2025
08bd735
Update license URI and improve expansion panel structure
SommerEngineering May 29, 2025
8455450
Refactor PandocDialog layout to move buttons into DialogActions
SommerEngineering May 29, 2025
436852e
Formatting
SommerEngineering May 29, 2025
bf010c8
Formatting
SommerEngineering May 29, 2025
0d4455b
Fixed version output
SommerEngineering May 29, 2025
51e7eb1
Fixed licence icon
SommerEngineering May 29, 2025
b963ecc
Fixed macOS spelling
SommerEngineering May 29, 2025
c6af287
Formatting
SommerEngineering May 29, 2025
d1eb861
Refactor BlockPadding to expression-bodied property
SommerEngineering May 29, 2025
bc5c747
Add SelectedIndex parameter to CodeTabs component
SommerEngineering May 29, 2025
cd3e402
Removed redundant init value
SommerEngineering May 29, 2025
bb2db55
Make PandocExecutableName public
SommerEngineering May 29, 2025
c28758c
Moved macOS ARM above x86
SommerEngineering May 29, 2025
75c56cb
Harmonized button color
SommerEngineering May 29, 2025
c2c60d7
Spelling
SommerEngineering May 29, 2025
b1eefca
Preselect the correct tab according to the current CPU architecture
SommerEngineering May 30, 2025
7debfa7
Add support for a tab change callback in the CodeTabs component
SommerEngineering May 30, 2025
b799d03
Change all code tabs at the same time
SommerEngineering May 30, 2025
5001912
Update paths and instructions in PandocDialog component
SommerEngineering May 30, 2025
564ec1d
Adjust panel class styling in the CodeTabs component
SommerEngineering May 30, 2025
3f07436
Refactored download code
SommerEngineering May 30, 2025
4a14e1b
Fixed installer code tabs
SommerEngineering May 30, 2025
d4c8142
Fixed the header formatting
SommerEngineering May 30, 2025
18c7e93
Fixed text formatting
SommerEngineering May 30, 2025
647f256
Adjusted buttons sizes
SommerEngineering May 30, 2025
17b5a32
Formatting
SommerEngineering May 30, 2025
8d9fb93
Fixed the inline link typos
SommerEngineering May 30, 2025
5e6b118
Simplified text formatting
SommerEngineering May 30, 2025
e4b2d6f
Rename isLoading to isLoadingLicence in the PandocDialog component
SommerEngineering May 30, 2025
1330519
Rename PANDOC_VERSION to LATEST_PANDOC_VERSION in PandocDialog
SommerEngineering May 30, 2025
a6703f1
Refactor PandocDialog to simplify state management
SommerEngineering May 30, 2025
32f7476
Changed loading placeholder
SommerEngineering May 30, 2025
3a424d7
Changed status page design
SommerEngineering May 30, 2025
ad59559
Add a simple cancel button to the install page
SommerEngineering May 30, 2025
0ac54af
Simplified string
SommerEngineering May 30, 2025
63a4c84
Applied title case
SommerEngineering May 30, 2025
7dca3a5
Renamed variable
SommerEngineering May 30, 2025
6697e8a
Remove unused JsRuntime injection from PandocDialog
SommerEngineering May 30, 2025
eb75109
Replace showInstallationPage field with a public parameter
SommerEngineering May 30, 2025
df3c28e
Go straight to the installation page of the pandoc dialog
SommerEngineering May 30, 2025
7f19a6b
Improve Pandoc download and extraction process; fixed *.tar.gz handling
SommerEngineering May 30, 2025
4635fe7
Fixed the dialog re-call to use the correct title and format
SommerEngineering May 30, 2025
9b8f2e5
Add ShowInitialResultInSnackbar parameter to PandocDialog
SommerEngineering May 30, 2025
bfcb012
Fixed local installation detection
SommerEngineering May 30, 2025
55e2911
Simplify Pandoc button text binding logic
SommerEngineering May 30, 2025
5b1e06e
Update minimum required Pandoc version to 3.7.0.2
SommerEngineering May 30, 2025
3c0d2cd
Refine Pandoc button logic for different installation states
SommerEngineering May 30, 2025
393dd7e
Add a progress indicator for Pandoc installation steps
SommerEngineering May 30, 2025
d165cbb
Formatting
SommerEngineering May 30, 2025
56eefa1
Fixed after-installation state
SommerEngineering May 30, 2025
e15d16e
Improve CPU architecture error message formatting
SommerEngineering May 30, 2025
fb75480
Refine and clarify Pandoc process error messages
SommerEngineering May 30, 2025
f16594f
Refine and clarify texts
SommerEngineering May 30, 2025
ebc8c2b
Add ManagePandocDependency component
SommerEngineering May 30, 2025
9cacdf7
Add ManagePandocDependency to local dialogs
SommerEngineering May 30, 2025
ec0c783
Refine Pandoc button color logic
SommerEngineering May 30, 2025
ccc1742
Added text content to the I18N system
SommerEngineering May 30, 2025
2a7a767
Replaced all cases, where I18N and markup strings where used together.
SommerEngineering May 30, 2025
8190802
Added I18N content
SommerEngineering May 30, 2025
ab4fa12
Added I18N content
SommerEngineering May 30, 2025
c23d72f
Improved translation
SommerEngineering May 30, 2025
b3a9c20
Add PandocProcessBuilder
SommerEngineering May 30, 2025
746d103
Refactor Pandoc command to use the PandocProcessBuilder
SommerEngineering May 30, 2025
47258a9
Updated changelog
SommerEngineering May 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Build/Commands/Pdfium.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static async Task InstallAsync(RID rid, string version)
//
Console.Write(" deploying ...");
var library = GetLibraryPath(rid);
if (string.IsNullOrEmpty(library.Path))
if (string.IsNullOrWhiteSpace(library.Path))
{
Console.WriteLine($" failed to find the library path for {rid.ToUserFriendlyName()}");
return;
Expand Down
6 changes: 3 additions & 3 deletions app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ else
@if (this.dataSourcePort < 1024)
{
<MudText Typo="Typo.body2">
@((MarkupString)T("<b>Warning:</b> Ports below 1024 are reserved for system services. Your ERI server need to run with elevated permissions (root user)."))
<b>@T("Warning:")</b> @T("Ports below 1024 are reserved for system services. Your ERI server need to run with elevated permissions (root user).")
</MudText>
}
</div>
Expand Down Expand Up @@ -326,7 +326,7 @@ else
</MudJustifiedText>

<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@((MarkupString)T("<b>Important:</b> The LLM may need to generate many files. This reaches the request limit of most providers. Typically, only a certain number of requests can be made per minute, and only a maximum number of tokens can be generated per minute. AI Studio automatically considers this. <b>However, generating all the files takes a certain amount of time.</b> Local or self-hosted models may work without these limitations and can generate responses faster. AI Studio dynamically adapts its behavior and always tries to achieve the fastest possible data processing."))
<b>@T("Important:")</b> @T("The LLM may need to generate many files. This reaches the request limit of most providers. Typically, only a certain number of requests can be made per minute, and only a maximum number of tokens can be generated per minute. AI Studio automatically considers this.") <b>@T("However, generating all the files takes a certain amount of time.")</b> @T("Local or self-hosted models may work without these limitations and can generate responses faster. AI Studio dynamically adapts its behavior and always tries to achieve the fastest possible data processing.")
</MudJustifiedText>

<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
Expand All @@ -340,7 +340,7 @@ else
</MudJustifiedText>

<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@((MarkupString)T("When you rebuild / re-generate the ERI server code, AI Studio proceeds as follows: All files generated last time will be deleted. All other files you have created remain. Then, the AI generates the new files. <b>But beware:</b> It may happen that the AI generates a file this time that you manually created last time. In this case, your manually created file will then be overwritten. Therefore, you should always create a Git repository and commit or revert all changes before using this assistant. With a diff visualization, you can immediately see where the AI has made changes. It is best to use an IDE suitable for your selected language for this purpose."))
@T("When you rebuild / re-generate the ERI server code, AI Studio proceeds as follows: All files generated last time will be deleted. All other files you have created remain. Then, the AI generates the new files.") <b>@T("But beware:")</b> @T("It may happen that the AI generates a file this time that you manually created last time. In this case, your manually created file will then be overwritten. Therefore, you should always create a Git repository and commit or revert all changes before using this assistant. With a diff visualization, you can immediately see where the AI has made changes. It is best to use an IDE suitable for your selected language for this purpose.")
</MudJustifiedText>

<MudTextSwitch Label="@T("Should we write the generated code to the file system?")" Disabled="@this.IsNoneERIServerSelected" @bind-Value="@this.writeToFilesystem" LabelOn="@T("Yes, please write or update all generated code to the file system")" LabelOff="@T("No, just show me the code")" />
Expand Down
223 changes: 215 additions & 8 deletions app/MindWork AI Studio/Assistants/I18N/allTexts.lua

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions app/MindWork AI Studio/Components/CodeBlock.razor
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@

@if (!this.IsInline)
@if (!this.IsInline)
{
@if (this.ParentTabs is null)
{
<MudPaper Class="code-block no-elevation" Style="@this.BlockPadding()">
<pre><code>@this.ChildContent</code></pre>
<MudPaper Class="code-block no-elevation" Style="@this.BlockPadding">
<pre>
<code>
@this.ChildContent
</code>
</pre>
</MudPaper>
}
}
else
{
<span class="inline-code-block"><kbd>@this.ChildContent</kbd></span>
<span class="inline-code-block">
<kbd>
@this.ChildContent
</kbd>
</span>
}

5 changes: 1 addition & 4 deletions app/MindWork AI Studio/Components/CodeBlock.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ void BlockSelf(RenderTreeBuilder builder)
}
}

private string BlockPadding()
{
return this.ParentTabs is null ? "padding: 16px !important;" : "padding: 8px !important";
}
private string BlockPadding => this.ParentTabs is null ? "padding: 16px !important;" : "padding: 8px !important";
}
4 changes: 2 additions & 2 deletions app/MindWork AI Studio/Components/CodeTabs.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<MudTabs @bind-ActivePanelIndex="selectedIndex" PanelClass="code-block" MinimumTabWidth="30px" Class="mt-2">
@foreach (var block in blocks)
<MudTabs ActivePanelIndex="this.SelectedIndex" ActivePanelIndexChanged="async idx => await this.TabChanged(idx)" PanelClass="code-block mt-1" MinimumTabWidth="30px" Class="mt-2">
@foreach (var block in this.blocks)
{
<MudTabPanel Text="@block.Title">
@block.Fragment
Expand Down
14 changes: 13 additions & 1 deletion app/MindWork AI Studio/Components/CodeTabs.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ public partial class CodeTabs : ComponentBase
[Parameter]
public RenderFragment? ChildContent { get; set; }

[Parameter]
public int SelectedIndex { get; set; }

[Parameter]
public EventCallback<int> SelectedIndexChanged { get; set; }

private readonly List<CodeTabItem> blocks = new();
private int selectedIndex;

internal void RegisterBlock(string title, RenderFragment fragment)
{
Expand All @@ -27,4 +32,11 @@ private class CodeTabItem

public RenderFragment Fragment { get; init; } = null!;
}

private async Task TabChanged(int index)
{
this.SelectedIndex = index;
await this.SelectedIndexChanged.InvokeAsync(index);
await this.InvokeAsync(this.StateHasChanged);
}
}
2 changes: 1 addition & 1 deletion app/MindWork AI Studio/Components/ExpansionPanel.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded">
<MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded" MaxHeight="@this.MaxHeight" ExpandedChanged="async s => await this.ExpandedChanged(s)">
<TitleContent>
<div class="d-flex align-center">
<MudIcon Icon="@this.HeaderIcon" Size="@this.IconSize" Color="@this.IconColor" class="mr-3"/>
Expand Down
6 changes: 6 additions & 0 deletions app/MindWork AI Studio/Components/ExpansionPanel.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public partial class ExpansionPanel : ComponentBase
[Parameter]
public string HeaderText { get; set; } = "n/a";

[Parameter]
public int? MaxHeight { get; set; }

[Parameter]
public Func<bool, Task> ExpandedChanged { get; set; } = _ => Task.CompletedTask;

[Parameter]
public RenderFragment? ChildContent { get; set; }

Expand Down
10 changes: 10 additions & 0 deletions app/MindWork AI Studio/Components/ManagePandocDependency.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@inherits MSGComponentBase

<MudStack Row="false" Class="mb-3 pa-3 border-dashed border rounded-lg">
<MudJustifiedText Typo="Typo.body1">
@this.DetermineIntroText()
</MudJustifiedText>
<MudButton Color="@this.DetermineButtonColor()" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
@this.DetermineButtonText()
</MudButton>
</MudStack>
97 changes: 97 additions & 0 deletions app/MindWork AI Studio/Components/ManagePandocDependency.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using AIStudio.Dialogs;
using AIStudio.Tools.Services;

using Microsoft.AspNetCore.Components;

using DialogOptions = AIStudio.Dialogs.DialogOptions;

namespace AIStudio.Components;

public partial class ManagePandocDependency : MSGComponentBase
{
[Parameter]
public string IntroText { get; set; } = string.Empty;

[Inject]
private IDialogService DialogService { get; init; } = null!;

[Inject]
private RustService RustService { get; init; } = null!;

private PandocInstallation pandocInstallation;

#region Overrides of MSGComponentBase

protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService, false);
}

#endregion

private Color DetermineButtonColor()
{
if (this.pandocInstallation == default)
return Color.Default;

switch (this.pandocInstallation)
{
case { CheckWasSuccessful: true, IsAvailable: true }:
return Color.Default;

case { CheckWasSuccessful: true, IsAvailable: false }:
return Color.Warning;

case { CheckWasSuccessful: false }:
return Color.Error;
}
}

private string DetermineButtonText()
{
if(this.pandocInstallation == default)
return T("Please wait while we check the availability of Pandoc.");

switch (this.pandocInstallation)
{
case { CheckWasSuccessful: true, IsAvailable: true }:
return T("Check your Pandoc installation");

case { CheckWasSuccessful: true, IsAvailable: false }:
return T("Update Pandoc");

case { CheckWasSuccessful: false }:
return T("Install Pandoc");
}
}

private string DetermineIntroText()
{
if (this.pandocInstallation == default)
return $"{this.IntroText} {T("Please wait while we check the availability of Pandoc.")}";

switch (this.pandocInstallation)
{
case { CheckWasSuccessful: true, IsAvailable: true }:
return $"{this.IntroText} {T("Your Pandoc installation meets the requirements.")}";

case { CheckWasSuccessful: true, IsAvailable: false }:
return $"{this.IntroText} {T("Your Pandoc installation is outdated. Please update it to the latest version to ensure compatibility with all features.")}";

case { CheckWasSuccessful: false }:
return $"{this.IntroText} {T("Pandoc is not installed or not available. Please install it to use the features that require Pandoc.")}";
}
}

private async Task ShowPandocDialogAsync()
{
var dialogReference = await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), DialogOptions.FULLSCREEN);
await dialogReference.Result;

// Refresh the availability of Pandoc after the dialog is closed:
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService, false);

await this.InvokeAsync(this.StateHasChanged);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
</MudJustifiedText>
}
}

<ManagePandocDependency IntroText="@T("For some data types, such as Office files, MindWork AI Studio requires the open-source application Pandoc.")"/>

<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
@foreach (var policy in Enum.GetValues<DataSourceSecurity>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
</MudJustifiedText>
}
}

<ManagePandocDependency IntroText="@T("For some data types, such as Office files, MindWork AI Studio requires the open-source application Pandoc.")"/>

<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
@foreach (var policy in Enum.GetValues<DataSourceSecurity>())
Expand Down
Loading