csharpdeeb25a2 | 1 | #nullable enable |
| 2 | |
| 3 | using CascadeIDE.Models.AgentChat; |
| 4 | using CascadeIDE.Models.Intercom; |
| 5 | using CascadeIDE.ViewModels; |
| 6 | |
| 7 | namespace CascadeIDE.Features.Chat; |
| 8 | |
| 9 | /// <summary>Единый commit подготовленного сообщения в ленту (ADR 0134).</summary> |
| 10 | public static class IntercomPreparedMessageCommit |
| 11 | { |
| 12 | public static ChatMessageViewModel ToViewModel( |
| 13 | string role, |
| 14 | string displayBody, |
| 15 | PreparedIntercomMessage prepared, |
| 16 | Guid? threadId = null, |
| 17 | Guid? parentMessageId = null) => |
| 18 | new( |
| 19 | role, |
| 20 | displayBody, |
| 21 | threadId: threadId, |
| 22 | parentMessageId: parentMessageId, |
| 23 | attachments: prepared.Outbound.Attachments, |
| 24 | senderWorkspaceContext: prepared.Outbound.SenderWorkspaceContext); |
| 25 | |
| 26 | public static string? FormatStatusHint(PreparedIntercomMessage prepared) |
| 27 | { |
| 28 | if (prepared.Status == IntercomMessagePrepareStatus.PartialSuccess && prepared.Warnings.Count > 0) |
| 29 | return "Вложения: " + string.Join("; ", prepared.Warnings); |
| 30 | |
| 31 | return null; |
| 32 | } |
| 33 | } |
| 34 | |
View only · write via MCP/CIDE