from __future__ import annotations

from app.agents.schemas.orchestration import SubTaskSpec
from app.agents.schemas.task import AgentTask


def subtask_spec_to_agent_task(spec: SubTaskSpec) -> AgentTask:
    return AgentTask(
        task_id=spec.subtask_id,
        title=spec.title,
        owner_agent_id=spec.role,
        role=spec.role,
        goal=spec.goal,
        parent_task_id=spec.parent_run_id,
        child_task_ids=[],
        expected_evidence=spec.expected_evidence,
    )
