feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.
This commit is contained in:
11
Core/Interfaces/ITranscriptionOrchestrator.cs
Normal file
11
Core/Interfaces/ITranscriptionOrchestrator.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Toak.Core.Interfaces;
|
||||
|
||||
public interface ITranscriptionOrchestrator
|
||||
{
|
||||
Task ProcessStartRecordingAsync();
|
||||
Task ProcessStopRecordingAsync(Socket client, bool pipeToStdout, bool copyToClipboard);
|
||||
void ProcessAbortAsync();
|
||||
}
|
||||
62
Core/Interfaces/Interfaces.cs
Normal file
62
Core/Interfaces/Interfaces.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Toak.Configuration;
|
||||
|
||||
namespace Toak.Core.Interfaces;
|
||||
|
||||
public interface IConfigProvider
|
||||
{
|
||||
ToakConfig LoadConfig();
|
||||
void SaveConfig(ToakConfig config);
|
||||
}
|
||||
|
||||
public interface ISpeechClient
|
||||
{
|
||||
Task<string> TranscribeAsync(string filePath, string language = "", string model = "whisper-large-v3-turbo");
|
||||
}
|
||||
|
||||
public interface ILlmClient
|
||||
{
|
||||
Task<string> RefineTextAsync(string rawTranscript, string systemPrompt, string model = "openai/gpt-oss-20b");
|
||||
IAsyncEnumerable<string> RefineTextStreamAsync(string rawTranscript, string systemPrompt, string model = "openai/gpt-oss-20b");
|
||||
}
|
||||
|
||||
public interface IAudioRecorder
|
||||
{
|
||||
string GetWavPath();
|
||||
void StartRecording();
|
||||
void StopRecording();
|
||||
}
|
||||
|
||||
public interface INotifications
|
||||
{
|
||||
void Notify(string title, string message = "");
|
||||
void PlaySound(string soundPath);
|
||||
}
|
||||
|
||||
public interface ITextInjector
|
||||
{
|
||||
Task<string> InjectStreamAsync(IAsyncEnumerable<string> textStream, string backend = "xdotool");
|
||||
Task InjectTextAsync(string text, string backend = "xdotool");
|
||||
}
|
||||
|
||||
public interface IHistoryManager
|
||||
{
|
||||
void SaveEntry(string rawText, string finalText, string? skillUsed, long timeTakenMs);
|
||||
List<HistoryEntry> LoadHistory();
|
||||
void ClearHistory();
|
||||
}
|
||||
|
||||
public interface IClipboardManager
|
||||
{
|
||||
void Copy(string text);
|
||||
}
|
||||
|
||||
public interface IRecordingStateTracker
|
||||
{
|
||||
int? GetRecordingPid();
|
||||
void SetRecording(int pid);
|
||||
void ClearRecording();
|
||||
bool IsRecording();
|
||||
}
|
||||
Reference in New Issue
Block a user