feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.
This commit is contained in:
@@ -9,7 +9,8 @@ public static class ConfigUpdaterCommand
|
||||
public static async Task ExecuteAsync(string key, string val, bool verbose)
|
||||
{
|
||||
Toak.Core.Logger.Verbose = verbose;
|
||||
var config = ConfigManager.LoadConfig();
|
||||
var configManager = new ConfigManager();
|
||||
var config = configManager.LoadConfig();
|
||||
key = key.ToLowerInvariant();
|
||||
val = val.ToLowerInvariant();
|
||||
|
||||
@@ -33,7 +34,7 @@ public static class ConfigUpdaterCommand
|
||||
return;
|
||||
}
|
||||
|
||||
ConfigManager.SaveConfig(config);
|
||||
configManager.SaveConfig(config);
|
||||
AnsiConsole.MarkupLine($"[green]Successfully[/] set {key} to [blue]{val}[/].");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,16 @@ public static class HistoryCommand
|
||||
{
|
||||
Logger.Verbose = verbose;
|
||||
|
||||
var historyManager = new HistoryManager();
|
||||
|
||||
if (shred)
|
||||
{
|
||||
HistoryManager.Shred();
|
||||
historyManager.ClearHistory();
|
||||
AnsiConsole.MarkupLine("[green]History successfully shredded.[/]");
|
||||
return;
|
||||
}
|
||||
|
||||
var entries = HistoryManager.LoadEntries();
|
||||
var entries = historyManager.LoadHistory();
|
||||
if (entries.Count == 0)
|
||||
{
|
||||
AnsiConsole.MarkupLine("[yellow]No history found.[/]");
|
||||
|
||||
@@ -14,7 +14,7 @@ public static class LatencyTestCommand
|
||||
public static async Task ExecuteAsync(bool verbose)
|
||||
{
|
||||
Logger.Verbose = verbose;
|
||||
var config = ConfigManager.LoadConfig();
|
||||
var config = new ConfigManager().LoadConfig();
|
||||
if (string.IsNullOrWhiteSpace(config.GroqApiKey))
|
||||
{
|
||||
AnsiConsole.MarkupLine("[red]Groq API Key is not configured.[/] Run 'toak onboard'.");
|
||||
|
||||
@@ -12,7 +12,8 @@ public static class OnboardCommand
|
||||
public static async Task ExecuteAsync(bool verbose)
|
||||
{
|
||||
Toak.Core.Logger.Verbose = verbose;
|
||||
var config = ConfigManager.LoadConfig();
|
||||
var configManager = new ConfigManager();
|
||||
var config = configManager.LoadConfig();
|
||||
|
||||
AnsiConsole.Write(new FigletText("Toak").Color(Color.Green));
|
||||
AnsiConsole.MarkupLine("[grey]Welcome to the Toak configuration wizard.[/]");
|
||||
@@ -71,7 +72,7 @@ public static class OnboardCommand
|
||||
.AddChoices(availableSkills));
|
||||
}
|
||||
|
||||
ConfigManager.SaveConfig(config);
|
||||
configManager.SaveConfig(config);
|
||||
|
||||
AnsiConsole.MarkupLine("\n[bold green]Configuration saved successfully![/]");
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public static class ShowCommand
|
||||
public static async Task ExecuteAsync(bool verbose)
|
||||
{
|
||||
Toak.Core.Logger.Verbose = verbose;
|
||||
var config = ConfigManager.LoadConfig();
|
||||
var config = new ConfigManager().LoadConfig();
|
||||
|
||||
var table = new Table();
|
||||
table.AddColumn("Setting");
|
||||
|
||||
@@ -13,7 +13,7 @@ public static class StatsCommand
|
||||
{
|
||||
Logger.Verbose = verbose;
|
||||
|
||||
var entries = HistoryManager.LoadEntries();
|
||||
var entries = new HistoryManager().LoadHistory();
|
||||
if (entries.Count == 0)
|
||||
{
|
||||
AnsiConsole.MarkupLine("[yellow]No history found. Cannot generate statistics.[/]");
|
||||
|
||||
Reference in New Issue
Block a user