{% if sessions %} {% for session in sessions %} {# Determine TTL state for visual indicator. We store ttl_seconds in the row itself as an informational field. The actual remaining time is approximated from created_at + ttl_seconds. #} {% set elapsed = (now - session.created_at.replace(tzinfo=None)).total_seconds() | int %} {% set remaining = [session.ttl_seconds - elapsed, 0] | max %} {% set pct = ((remaining / session.ttl_seconds) * 100) | int if session.ttl_seconds > 0 else 0 %} {# Choose styling based on remaining TTL #} {% if remaining <= 5 %} {% set state = "crit" %} {% set item_class = "ttl-critical" %} {% elif remaining <= 30 %} {% set state = "warn" %} {% set item_class = "ttl-warning" %} {% else %} {% set state = "ok" %} {% set item_class = "" %} {% endif %}
{{ session.user_name }}
TOKEN: {{ session.token }}
{% if remaining <= 0 %} 💀 EXPIRED {% elif remaining <= 5 %} ⚠ {{ remaining }}s {% else %} ⏳ {{ remaining }}s {% endif %}
{{ session.memory_fragment }}
Stored: {{ session.created_at.strftime('%H:%M:%S') if session.created_at else '—' }} TTL: {{ session.ttl_seconds }}s ({{ pct }}% remaining)
{% endfor %} {% else %}
👻

No active memory tokens — all memories have dissolved.

Seed new tokens with make seed

{% endif %}