csharpdeeb25a2 | 1 | #nullable enable |
| 2 | |
| 3 | using CascadeIDE.Services; |
| 4 | |
| 5 | namespace CascadeIDE.Features.Chat; |
| 6 | |
| 7 | /// <summary>Фасад slash-preview; правила — <see cref="SlashCommandPreviewRulePipeline"/> (ADR 0138).</summary> |
| 8 | internal static class SlashCommandPreviewEvaluator |
| 9 | { |
| 10 | public static SlashCommandPreviewResult Evaluate(string? bufferText, SlashCommandAnchorPreviewResolver? resolveAnchor = null) => |
| 11 | SlashCommandPreviewRulePipeline.Evaluate(bufferText, resolveAnchor); |
| 12 | |
| 13 | public static bool TryEvaluateSummary(string? bufferText, out string? summary) |
| 14 | { |
| 15 | var result = Evaluate(bufferText); |
| 16 | summary = result.Text; |
| 17 | return result.HasText; |
| 18 | } |
| 19 | |
| 20 | public static SlashCommandPreviewKind MapResolveOutcome(string? resolveOutcome) |
| 21 | { |
| 22 | if (string.Equals(resolveOutcome?.Trim(), IntercomAttachmentRevealPlan.OutcomeResolved, StringComparison.OrdinalIgnoreCase)) |
| 23 | return SlashCommandPreviewKind.Ok; |
| 24 | |
| 25 | if (string.IsNullOrWhiteSpace(resolveOutcome)) |
| 26 | return SlashCommandPreviewKind.Incomplete; |
| 27 | |
| 28 | return SlashCommandPreviewKind.Incomplete; |
| 29 | } |
| 30 | } |
| 31 | |
View only · write via MCP/CIDE