from __future__ import annotations

from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step1_resolve_source.step import (
    ResolveSourceStep,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step2_load_source_content.step import (
    LoadSourceContentStep,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step3_parse_requirements.step import (
    ParseRequirementsStep,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step4_prepare_tasks.step import (
    PrepareRequirementTasksStep,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step4_load_rules.step import LoadRulesStep
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step5_execute_subprocesses.step import (
    ExecuteRequirementSubprocessesStep,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.steps.step6_finalize.step import FinalizeAnswerStep
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.workflow_runtime.buffered_graph import (
    DocUpdateFromFeatureV2WorkflowGraph,
)
from app.core.agent.processes.v2.workflows.doc_update_from_feature_v2.workflow_runtime.context import (
    DocUpdateFromFeatureV2Context,
)
from app.core.agent.utils.llm import AgentLlmService


class DocUpdateFromFeatureV2Graph(DocUpdateFromFeatureV2WorkflowGraph[DocUpdateFromFeatureV2Context]):
    def __init__(self, llm: AgentLlmService) -> None:
        super().__init__(
            workflow_id="v2.docs_update.from_feature_v2",
            source="workflow.v2.docs_update.from_feature_v2",
            steps=[
                ResolveSourceStep(),
                LoadSourceContentStep(),
                ParseRequirementsStep(),
                PrepareRequirementTasksStep(llm=llm),
                LoadRulesStep(),
                ExecuteRequirementSubprocessesStep(llm=llm),
                FinalizeAnswerStep(),
            ],
        )
