using Microsoft.Extensions.DependencyInjection;
using Journal.AI;
using Journal.Core;
using Journal.Core.Services.Speech;
using Journal.Core.Services.Sidecar;
using Journal.Sidecar;

Console.OutputEncoding = System.Text.Encoding.UTF8;
Console.InputEncoding = System.Text.Encoding.UTF8;

var services = new ServiceCollection();
services.AddFragmentServices();
services.AddLlamaSharpServices();
services.AddSingleton<IS2TService, LocalWhisperS2TService>();
services.AddSingleton<Entry>();
var provider = services.BuildServiceProvider();

var entry = provider.GetRequiredService<Entry>();
var cli = provider.GetRequiredService<SidecarCli>();
var exitCode = await cli.RunAsync(args, entry);
Environment.ExitCode = exitCode;
