"""Human-in-the-loop gate for high-risk tool names (Temporal approval pattern).

Tool names matching ``(push|apply|send|delete)`` should not execute inside the agent
process without an explicit Temporal resume signal. In LangGraph, prefer ``interrupt``
from ``langgraph.types`` so the checkpoint captures the pending decision; the Temporal
worker should treat an ``interrupt`` payload as a workflow wait + external approval API.
"""

from __future__ import annotations

import re

_DANGEROUS = re.compile(r"(push|apply|send|delete)", re.IGNORECASE)


def tool_name_requires_temporal_approval(tool_name: str) -> bool:
    return bool(_DANGEROUS.search(tool_name))
