"""Push a glance card to the HUD. Lets the agent write to the display.

Copy this next to notes.py in your tools directory to give FERAL the display.
"""
import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from hud import push  # noqa: E402

ACTIONS = [
    {
        "name": "show_glance",
        "category": "actuator",
        "permission_tier": "active",
        "description": (
            "Show a card on the glasses display. Three lines, 24 characters "
            "each, cut not wrapped. Replaces whatever is there."
        ),
        "params": {"line1": "str", "line2": "str", "line3": "str"},
        "requires_confirmation": False,
    }
]


def show_glance(line1: str = "", line2: str = "", line3: str = "") -> str:
    lines = push([line1, line2, line3])
    return "Showing: " + " / ".join(l for l in lines if l)
