using System.Text.Json.Serialization;

namespace AxCopilot.Services.Agent;

/// <summary>Phase 18-A: 코디네이터 에이전트 실행 계획.</summary>
public class CoordinatorPlan
{
    [JsonPropertyName("original_request")]
    public string OriginalRequest { get; init; } = "";

    [JsonPropertyName("tasks")]
    public List<CoordinatorSubTask> Tasks { get; init; } = new();
}

public enum SubTaskStatus { Pending, Running, Completed, Failed }

public class CoordinatorSubTask
{
    [JsonPropertyName("id")]
    public string Id { get; set; } = Guid.NewGuid().ToString("N")[..6];

    [JsonPropertyName("agent_type")]
    public string AgentType { get; set; } = "implementer";

    [JsonPropertyName("description")]
    public string Description { get; set; } = "";

    [JsonPropertyName("dependencies")]
    public List<string> Dependencies { get; set; } = new();  // 선행 SubTask Id 목록

    [JsonIgnore]
    public SubTaskStatus Status { get; set; } = SubTaskStatus.Pending;

    [JsonIgnore]
    public string? Result { get; set; }

    [JsonIgnore]
    public string? Error { get; set; }
}
