feat: Implement history tracking with new CLI commands for viewing past transcripts and usage statistics.
This commit is contained in:
@@ -46,8 +46,9 @@ public static class TextInjector
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task InjectStreamAsync(IAsyncEnumerable<string> tokenStream, string backend)
|
||||
public static async Task<string> InjectStreamAsync(IAsyncEnumerable<string> tokenStream, string backend)
|
||||
{
|
||||
string fullText = string.Empty;
|
||||
try
|
||||
{
|
||||
ProcessStartInfo pInfo;
|
||||
@@ -77,13 +78,14 @@ public static class TextInjector
|
||||
}
|
||||
|
||||
using var process = Process.Start(pInfo);
|
||||
if (process == null) return;
|
||||
if (process == null) return string.Empty;
|
||||
|
||||
Logger.LogDebug("Started stream injection process, waiting for tokens...");
|
||||
|
||||
await foreach (var token in tokenStream)
|
||||
{
|
||||
Logger.LogDebug($"Injecting token: '{token}'");
|
||||
fullText += token;
|
||||
await process.StandardInput.WriteAsync(token);
|
||||
await process.StandardInput.FlushAsync();
|
||||
}
|
||||
@@ -97,5 +99,6 @@ public static class TextInjector
|
||||
Console.WriteLine($"[TextInjector] Error injecting text stream: {ex.Message}");
|
||||
Notifications.Notify("Injection Error", "Could not type text stream into window.");
|
||||
}
|
||||
return fullText;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user