up
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
This commit is contained in:
@@ -1236,8 +1236,78 @@ internal static class CommandFactory
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var explainOptions = CreateAdvisoryOptions();
|
||||
var explain = new Command("explain", "Explain an advisory conflict set with narrative and rationale.");
|
||||
AddAdvisoryOptions(explain, explainOptions);
|
||||
explain.SetAction((parseResult, _) =>
|
||||
{
|
||||
var advisoryKey = parseResult.GetValue(explainOptions.AdvisoryKey) ?? string.Empty;
|
||||
var artifactId = parseResult.GetValue(explainOptions.ArtifactId);
|
||||
var artifactPurl = parseResult.GetValue(explainOptions.ArtifactPurl);
|
||||
var policyVersion = parseResult.GetValue(explainOptions.PolicyVersion);
|
||||
var profile = parseResult.GetValue(explainOptions.Profile) ?? "default";
|
||||
var sections = parseResult.GetValue(explainOptions.Sections) ?? Array.Empty<string>();
|
||||
var forceRefresh = parseResult.GetValue(explainOptions.ForceRefresh);
|
||||
var timeoutSeconds = parseResult.GetValue(explainOptions.TimeoutSeconds) ?? 120;
|
||||
var outputFormat = ParseAdvisoryOutputFormat(parseResult.GetValue(explainOptions.Format));
|
||||
var outputPath = parseResult.GetValue(explainOptions.Output);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleAdviseRunAsync(
|
||||
services,
|
||||
AdvisoryAiTaskType.Conflict,
|
||||
advisoryKey,
|
||||
artifactId,
|
||||
artifactPurl,
|
||||
policyVersion,
|
||||
profile,
|
||||
sections,
|
||||
forceRefresh,
|
||||
timeoutSeconds,
|
||||
outputFormat,
|
||||
outputPath,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var remediateOptions = CreateAdvisoryOptions();
|
||||
var remediate = new Command("remediate", "Generate remediation guidance for an advisory.");
|
||||
AddAdvisoryOptions(remediate, remediateOptions);
|
||||
remediate.SetAction((parseResult, _) =>
|
||||
{
|
||||
var advisoryKey = parseResult.GetValue(remediateOptions.AdvisoryKey) ?? string.Empty;
|
||||
var artifactId = parseResult.GetValue(remediateOptions.ArtifactId);
|
||||
var artifactPurl = parseResult.GetValue(remediateOptions.ArtifactPurl);
|
||||
var policyVersion = parseResult.GetValue(remediateOptions.PolicyVersion);
|
||||
var profile = parseResult.GetValue(remediateOptions.Profile) ?? "default";
|
||||
var sections = parseResult.GetValue(remediateOptions.Sections) ?? Array.Empty<string>();
|
||||
var forceRefresh = parseResult.GetValue(remediateOptions.ForceRefresh);
|
||||
var timeoutSeconds = parseResult.GetValue(remediateOptions.TimeoutSeconds) ?? 120;
|
||||
var outputFormat = ParseAdvisoryOutputFormat(parseResult.GetValue(remediateOptions.Format));
|
||||
var outputPath = parseResult.GetValue(remediateOptions.Output);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleAdviseRunAsync(
|
||||
services,
|
||||
AdvisoryAiTaskType.Remediation,
|
||||
advisoryKey,
|
||||
artifactId,
|
||||
artifactPurl,
|
||||
policyVersion,
|
||||
profile,
|
||||
sections,
|
||||
forceRefresh,
|
||||
timeoutSeconds,
|
||||
outputFormat,
|
||||
outputPath,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
advise.Add(run);
|
||||
advise.Add(summarize);
|
||||
advise.Add(explain);
|
||||
advise.Add(remediate);
|
||||
return advise;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user