"""Token-free (regex) detection of user *reactions* to the agent. The only kind today is ``vibe`` — affection/gratitude aimed at the agent (``ily``, ``<3``, ``good bot``, a heart emoji), NOT general positive sentiment ("this is great" does not fire). Single source of truth for the CLI pet, TUI heart and desktop hearts via ``AIAgent.reaction_callback``; :func:`detect_reaction` returns a *kind* string so new kinds can be added without touching callers. """ from __future__ import annotations import re #: The affection/gratitude reaction — the only kind today. VIBE = "vibe" # Narrow lexicon: gratitude + love aimed at the agent, hearts, ``<3`` (not `` str | None: """Return the reaction kind for *text* (currently :data:`VIBE`), or ``None``.""" return VIBE if text and _VIBE_RE.search(text) else None