"""Lightweight workflow tool for running a list of text tasks."""

from __future__ import annotations

from typing import Any, Dict, List

from armorer.agent_sdk import tool


@tool(category="workflow", verification_level="workflow_step")
def workflow(tasks: List[str]) -> Dict[str, Any]:
    """
    Execute a simple sequential workflow description.

    Args:
        tasks: list of human-readable task steps.
    """
    normalized = [t.strip() for t in tasks if str(t).strip()]
    completed = [{"step": i + 1, "task": t, "status": "completed"} for i, t in enumerate(normalized)]
    return {
        "status": "success",
        "count": len(completed),
        "results": completed,
    }
