up
This commit is contained in:
@@ -233,10 +233,15 @@ internal static class CommandHandlers
|
||||
{
|
||||
var console = AnsiConsole.Console;
|
||||
|
||||
console.MarkupLine($"[bold]Scan[/]: {result.ScanId}");
|
||||
console.MarkupLine($"Image: {result.ImageDigest}");
|
||||
console.MarkupLine($"Generated: {result.GeneratedAt:O}");
|
||||
console.MarkupLine($"Outcome: {result.Graph.Outcome}");
|
||||
console.MarkupLine($"[bold]Scan[/]: {result.ScanId}");
|
||||
console.MarkupLine($"Image: {result.ImageDigest}");
|
||||
console.MarkupLine($"Generated: {result.GeneratedAt:O}");
|
||||
console.MarkupLine($"Outcome: {result.Graph.Outcome}");
|
||||
|
||||
if (result.BestPlan is not null)
|
||||
{
|
||||
console.MarkupLine($"Best Terminal: {result.BestPlan.TerminalPath} (conf {result.BestPlan.Confidence:F1}, user {result.BestPlan.User}, cwd {result.BestPlan.WorkingDirectory})");
|
||||
}
|
||||
|
||||
var planTable = new Table()
|
||||
.AddColumn("Terminal")
|
||||
@@ -248,14 +253,15 @@ internal static class CommandHandlers
|
||||
|
||||
foreach (var plan in result.Graph.Plans.OrderByDescending(p => p.Confidence))
|
||||
{
|
||||
planTable.AddRow(
|
||||
plan.TerminalPath,
|
||||
plan.Runtime ?? "-",
|
||||
plan.Type.ToString(),
|
||||
plan.Confidence.ToString("F1", CultureInfo.InvariantCulture),
|
||||
plan.User,
|
||||
plan.WorkingDirectory);
|
||||
}
|
||||
var confidence = plan.Confidence.ToString("F1", CultureInfo.InvariantCulture);
|
||||
planTable.AddRow(
|
||||
plan.TerminalPath,
|
||||
plan.Runtime ?? "-",
|
||||
plan.Type.ToString(),
|
||||
confidence,
|
||||
plan.User,
|
||||
plan.WorkingDirectory);
|
||||
}
|
||||
|
||||
if (planTable.Rows.Count > 0)
|
||||
{
|
||||
|
||||
@@ -909,11 +909,11 @@ internal sealed class BackendOperationsClient : IBackendOperationsClient
|
||||
throw new InvalidOperationException(failure);
|
||||
}
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<EntryTraceResponseModel>(SerializerOptions, cancellationToken).ConfigureAwait(false);
|
||||
if (result is null)
|
||||
{
|
||||
throw new InvalidOperationException("EntryTrace response payload was empty.");
|
||||
}
|
||||
var result = await response.Content.ReadFromJsonAsync<EntryTraceResponseModel>(SerializerOptions, cancellationToken).ConfigureAwait(false);
|
||||
if (result is null)
|
||||
{
|
||||
throw new InvalidOperationException("EntryTrace response payload was empty.");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -9,4 +9,5 @@ internal sealed record EntryTraceResponseModel(
|
||||
string ImageDigest,
|
||||
DateTimeOffset GeneratedAt,
|
||||
EntryTraceGraph Graph,
|
||||
IReadOnlyList<string> Ndjson);
|
||||
IReadOnlyList<string> Ndjson,
|
||||
EntryTracePlan? BestPlan);
|
||||
|
||||
Reference in New Issue
Block a user