refactor(worker): remove MessageParser (replaced by StreamAnalyzer)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ClaudeDo.Worker.Runner;
|
||||
|
||||
public static class MessageParser
|
||||
{
|
||||
public static bool TryExtractResult(string ndjsonLine, out string? result)
|
||||
{
|
||||
result = null;
|
||||
if (string.IsNullOrWhiteSpace(ndjsonLine))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
using var doc = JsonDocument.Parse(ndjsonLine);
|
||||
var root = doc.RootElement;
|
||||
|
||||
if (root.TryGetProperty("type", out var typeProp) &&
|
||||
typeProp.GetString() == "result" &&
|
||||
root.TryGetProperty("result", out var resultProp))
|
||||
{
|
||||
result = resultProp.GetString();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
// Malformed JSON — not a result line.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user