from AgentCoord.PlanEngine.planOutline_Generator import generate_PlanOutline
# from AgentCoord.PlanEngine.AgentSelection_Generator import (
#     generate_AgentSelection,
# )


def generate_basePlan(
    General_Goal, Agent_Board, AgentProfile_Dict, InitialObject_List
):
    """
    优化模式：生成大纲 + 智能体选择，但不生成任务流程
    优化用户体验：
    1. 快速生成大纲和分配智能体
    2. 用户可以看到完整的大纲和智能体图标
    3. TaskProcess由前端通过 fillStepTask API 异步填充

    """
    # 参数保留以保持接口兼容性
    _ = AgentProfile_Dict
    PlanOutline = generate_PlanOutline(
        InitialObject_List=InitialObject_List, General_Goal=General_Goal
    )

    basePlan = {
        "General Goal": General_Goal,
        "Initial Input Object": InitialObject_List,
        "Collaboration Process": []
    }

    for stepItem in PlanOutline:
        # # 为每个步骤分配智能体
        # Current_Task = {
        #     "TaskName": stepItem["StepName"],
        #     "InputObject_List": stepItem["InputObject_List"],
        #     "OutputObject": stepItem["OutputObject"],
        #     "TaskContent": stepItem["TaskContent"],
        # }
        # AgentSelection = generate_AgentSelection(
        #     General_Goal=General_Goal,
        #     Current_Task=Current_Task,
        #     Agent_Board=Agent_Board,
        # )

        # 添加智能体选择，但不添加任务流程
        stepItem["AgentSelection"] = []
        stepItem["TaskProcess"] = []  # 空数组，由前端异步填充
        stepItem["Collaboration_Brief_frontEnd"] = {
            "template": "",
            "data": {}
        }
        basePlan["Collaboration Process"].append(stepItem)

    return basePlan