1
0

feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.

This commit is contained in:
2026-02-28 15:36:03 +01:00
parent ac0ac2397b
commit 0577640da9
18 changed files with 356 additions and 175 deletions

View File

@@ -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))
{