| | | 1 | | namespace Elsa.AI.Abstractions.Models; |
| | | 2 | | |
| | | 3 | | public record AIProposal |
| | | 4 | | { |
| | 0 | 5 | | public string Id { get; init; } = Guid.NewGuid().ToString("N"); |
| | 0 | 6 | | public string? TenantId { get; init; } |
| | 0 | 7 | | public string ConversationId { get; init; } = ""; |
| | 0 | 8 | | public AIProposalKind Kind { get; init; } |
| | 0 | 9 | | public AIProposalStatus Status { get; init; } = AIProposalStatus.Draft; |
| | 0 | 10 | | public string? BaselineWorkflowDefinitionId { get; init; } |
| | 0 | 11 | | public string? BaselineVersionId { get; init; } |
| | 0 | 12 | | public JsonObject WorkflowPayload { get; init; } = []; |
| | 0 | 13 | | public string Rationale { get; init; } = ""; |
| | 0 | 14 | | public ICollection<string> Warnings { get; init; } = []; |
| | 0 | 15 | | public ICollection<AIValidationDiagnostic> ValidationDiagnostics { get; init; } = []; |
| | 0 | 16 | | public AIGraphDiff? GraphDiff { get; init; } |
| | 0 | 17 | | public string CreatedBy { get; init; } = ""; |
| | 0 | 18 | | public DateTimeOffset CreatedAt { get; init; } = DateTimeOffset.UtcNow; |
| | 0 | 19 | | public string? ReviewedBy { get; init; } |
| | 0 | 20 | | public DateTimeOffset? ReviewedAt { get; init; } |
| | 0 | 21 | | public string? AppliedBy { get; init; } |
| | 0 | 22 | | public DateTimeOffset? AppliedAt { get; init; } |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | public record AIValidationDiagnostic |
| | | 26 | | { |
| | | 27 | | public string Code { get; init; } = default!; |
| | | 28 | | public string Message { get; init; } = ""; |
| | | 29 | | public AIValidationSeverity Severity { get; init; } = AIValidationSeverity.Warning; |
| | | 30 | | public string? Path { get; init; } |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | public record AIGraphDiff |
| | | 34 | | { |
| | | 35 | | public ICollection<string> AddedActivityIds { get; init; } = []; |
| | | 36 | | public ICollection<string> RemovedActivityIds { get; init; } = []; |
| | | 37 | | public ICollection<string> ChangedActivityIds { get; init; } = []; |
| | | 38 | | public JsonObject Data { get; init; } = []; |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | public enum AIProposalKind |
| | | 42 | | { |
| | | 43 | | WorkflowCreate, |
| | | 44 | | WorkflowUpdate |
| | | 45 | | } |
| | | 46 | | |
| | | 47 | | public enum AIProposalStatus |
| | | 48 | | { |
| | | 49 | | Draft, |
| | | 50 | | Validated, |
| | | 51 | | Blocked, |
| | | 52 | | Approved, |
| | | 53 | | Rejected, |
| | | 54 | | Applied, |
| | | 55 | | Expired |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | public enum AIValidationSeverity |
| | | 59 | | { |
| | | 60 | | Information, |
| | | 61 | | Warning, |
| | | 62 | | Error |
| | | 63 | | } |