feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.
This commit is contained in:
@@ -4,15 +4,21 @@ using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Toak.Serialization;
|
||||
using Toak.Core.Interfaces;
|
||||
|
||||
namespace Toak.Core;
|
||||
|
||||
public static class HistoryManager
|
||||
public class HistoryManager : IHistoryManager
|
||||
{
|
||||
private static readonly string HistoryDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "toak");
|
||||
private static readonly string HistoryFile = Path.Combine(HistoryDir, "history.jsonl");
|
||||
private readonly string HistoryDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "toak");
|
||||
private readonly string HistoryFile;
|
||||
|
||||
public static void SaveEntry(string rawTranscript, string refinedText, string? skillName, long durationMs)
|
||||
public HistoryManager()
|
||||
{
|
||||
HistoryFile = Path.Combine(HistoryDir, "history.jsonl");
|
||||
}
|
||||
|
||||
public void SaveEntry(string rawTranscript, string refinedText, string? skillName, long durationMs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -44,7 +50,7 @@ public static class HistoryManager
|
||||
}
|
||||
}
|
||||
|
||||
public static List<HistoryEntry> LoadEntries()
|
||||
public List<HistoryEntry> LoadHistory()
|
||||
{
|
||||
var entries = new List<HistoryEntry>();
|
||||
if (!File.Exists(HistoryFile)) return entries;
|
||||
@@ -85,7 +91,7 @@ public static class HistoryManager
|
||||
return entries;
|
||||
}
|
||||
|
||||
public static void Shred()
|
||||
public void ClearHistory()
|
||||
{
|
||||
if (File.Exists(HistoryFile))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user