Skip to content

Commit fc64c0b

Browse files
Improve ipc (#102)
1 parent 47f5756 commit fc64c0b

File tree

81 files changed

+2413
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2413
-804
lines changed

.github/workflows/build-and-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ jobs:
489489
uses: actions/cache@v4
490490
id: linux_arm_cache
491491
with:
492-
path: $RUNNER_TEMP/linux_arm_qemu_cache.img
492+
path: ${{ runner.temp }}/linux_arm_qemu_cache.img
493493

494494
# When the entire key matches, Rust might just create the bundles using the current .NET build:
495495
key: target-linux-arm64-rust-${{ env.RUST_VERSION }}-dependencies-${{ env.CARGO_LOCK_HASH }}
@@ -544,15 +544,15 @@ jobs:
544544
- name: Add the built runner image to the cache
545545
if: ${{ steps.linux_arm_cache.outputs.cache-hit != 'true' && env.SKIP != 'true' }}
546546
run: |
547-
mv ${{ steps.build-linux-arm-runner.outputs.image }} $RUNNER_TEMP/linux_arm_qemu_cache.img
547+
mv ${{ steps.build-linux-arm-runner.outputs.image }} ${{ runner.temp }}/linux_arm_qemu_cache.img
548548
549549
- name: Build Tauri project
550550
if: ${{ env.SKIP != 'true' }}
551551
uses: pguyot/arm-runner-action@v2
552552
id: build-linux-arm
553553

554554
with:
555-
base_image: file://$RUNNER_TEMP/linux_arm_qemu_cache.img
555+
base_image: file://${{ runner.temp }}/linux_arm_qemu_cache.img
556556
cpu: cortex-a53
557557
optimize_image: false
558558
copy_artifact_path: runtime
@@ -845,8 +845,8 @@ jobs:
845845
- name: Create release
846846
uses: softprops/action-gh-release@v2
847847
with:
848-
prerelease: false
849-
draft: false
848+
prerelease: true
849+
draft: true
850850
make_latest: true
851851
body: ${{ env.CHANGELOG }}
852852
name: "Release ${{ env.FORMATTED_VERSION }}"

app/MindWork AI Studio/Agents/AgentBase.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using AIStudio.Chat;
22
using AIStudio.Provider;
33
using AIStudio.Settings;
4-
using AIStudio.Tools;
54

65
// ReSharper disable MemberCanBePrivate.Global
76

87
namespace AIStudio.Agents;
98

10-
public abstract class AgentBase(SettingsManager settingsManager, IJSRuntime jsRuntime, ThreadSafeRandom rng) : IAgent
9+
public abstract class AgentBase(ILogger<AgentBase> logger, SettingsManager settingsManager, ThreadSafeRandom rng) : IAgent
1110
{
1211
protected SettingsManager SettingsManager { get; init; } = settingsManager;
1312

14-
protected IJSRuntime JsRuntime { get; init; } = jsRuntime;
15-
1613
protected ThreadSafeRandom RNG { get; init; } = rng;
14+
15+
protected ILogger<AgentBase> Logger { get; init; } = logger;
1716

1817
/// <summary>
1918
/// Represents the type or category of this agent.
@@ -104,6 +103,6 @@ protected async Task AddAIResponseAsync(ChatThread thread, DateTimeOffset time)
104103
// Use the selected provider to get the AI response.
105104
// By awaiting this line, we wait for the entire
106105
// content to be streamed.
107-
await aiText.CreateFromProviderAsync(providerSettings.CreateProvider(), this.JsRuntime, this.SettingsManager, providerSettings.Model, thread);
106+
await aiText.CreateFromProviderAsync(providerSettings.CreateProvider(this.Logger), this.SettingsManager, providerSettings.Model, thread);
108107
}
109108
}

app/MindWork AI Studio/Agents/AgentTextContentCleaner.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using AIStudio.Chat;
22
using AIStudio.Settings;
3-
using AIStudio.Tools;
43

54
namespace AIStudio.Agents;
65

7-
public sealed class AgentTextContentCleaner(SettingsManager settingsManager, IJSRuntime jsRuntime, ThreadSafeRandom rng) : AgentBase(settingsManager, jsRuntime, rng)
6+
public sealed class AgentTextContentCleaner(ILogger<AgentBase> logger, SettingsManager settingsManager, ThreadSafeRandom rng) : AgentBase(logger, settingsManager, rng)
87
{
98
private static readonly ContentBlock EMPTY_BLOCK = new()
109
{

app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Text;
22

33
using AIStudio.Chat;
4-
using AIStudio.Tools;
54

65
namespace AIStudio.Assistants.Agenda;
76

app/MindWork AI Studio/Assistants/AssistantBase.razor.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
using AIStudio.Chat;
22
using AIStudio.Provider;
33
using AIStudio.Settings;
4-
using AIStudio.Tools;
54

65
using Microsoft.AspNetCore.Components;
76

7+
using RustService = AIStudio.Tools.RustService;
8+
89
namespace AIStudio.Assistants;
910

1011
public abstract partial class AssistantBase : ComponentBase
1112
{
1213
[Inject]
13-
protected SettingsManager SettingsManager { get; set; } = null!;
14+
protected SettingsManager SettingsManager { get; init; } = null!;
1415

1516
[Inject]
1617
protected IJSRuntime JsRuntime { get; init; } = null!;
@@ -22,11 +23,14 @@ public abstract partial class AssistantBase : ComponentBase
2223
protected ISnackbar Snackbar { get; init; } = null!;
2324

2425
[Inject]
25-
protected Rust Rust { get; init; } = null!;
26+
protected RustService RustService { get; init; } = null!;
2627

2728
[Inject]
2829
protected NavigationManager NavigationManager { get; init; } = null!;
2930

31+
[Inject]
32+
protected ILogger<AssistantBase> Logger { get; init; } = null!;
33+
3034
internal const string AFTER_RESULT_DIV_ID = "afterAssistantResult";
3135
internal const string RESULT_DIV_ID = "assistantResult";
3236

@@ -151,7 +155,7 @@ protected async Task<string> AddAIResponseAsync(DateTimeOffset time)
151155
// Use the selected provider to get the AI response.
152156
// By awaiting this line, we wait for the entire
153157
// content to be streamed.
154-
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(), this.JsRuntime, this.SettingsManager, this.providerSettings.Model, this.chatThread);
158+
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(this.Logger), this.SettingsManager, this.providerSettings.Model, this.chatThread);
155159

156160
this.isProcessing = false;
157161
this.StateHasChanged();
@@ -162,7 +166,7 @@ protected async Task<string> AddAIResponseAsync(DateTimeOffset time)
162166

163167
protected async Task CopyToClipboard()
164168
{
165-
await this.Rust.CopyText2Clipboard(this.JsRuntime, this.Snackbar, this.Result2Copy());
169+
await this.RustService.CopyText2Clipboard(this.Snackbar, this.Result2Copy());
166170
}
167171

168172
private static string? GetButtonIcon(string icon)

app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System.Text;
22

3-
using AIStudio.Tools;
4-
53
namespace AIStudio.Assistants.Coding;
64

75
public partial class AssistantCoding : AssistantBaseCore

app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Text;
22

33
using AIStudio.Chat;
4-
using AIStudio.Tools;
54

65
namespace AIStudio.Assistants.EMail;
76

app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using AIStudio.Chat;
2-
using AIStudio.Tools;
32

43
namespace AIStudio.Assistants.GrammarSpelling;
54

app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using AIStudio.Tools;
2-
31
namespace AIStudio.Assistants.IconFinder;
42

53
public partial class AssistantIconFinder : AssistantBaseCore

app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using AIStudio.Tools;
2-
31
namespace AIStudio.Assistants.LegalCheck;
42

53
public partial class AssistantLegalCheck : AssistantBaseCore

0 commit comments

Comments
 (0)