{% extends "server/base.html" %} {% import "activity/macros.html" as m with context %} {% set short = ref(agent.id) %} {% block title %}{{ t.text("activity.live.title") }}{% endblock %} {% block top %}{% endblock %} {% block head %}{% endblock %} {% block body %} {# a card a turn in progress: where it is and how long it has run, what set it off, the calls it made and what it is doing now, and what it used #}
{% for turn in running %} {% set message = messages.get((agent.id, turn.message_id)) %}

{{ t.text("activity.live.title") }} {{ m.conversation(names.get(turn.thread_id)) }}

{% if turn.channel %}{{ m.logo(turn.channel) }}{{ t.text("activity.kind." ~ (turn.target_kind or "dm")) }}{% endif %} {{ m.icon("clock") }}{{ (now_ms - turn.started_ms) | duration("timer") }}
{% if message and message.name == "reminder.fired" %}
{{ m.icon("alarm-clock") }}
{{ t.text("activity.reminder") }}{{ message.metadata.get("title") or "" }}
{% elif message %} {% set who = m.sender(message) %}
{{ who[:1] | upper }}
{{ who }}{{ message.metadata.get("text") or "" }}
{% endif %}
{% for step in steps.get(turn.turn_id, []) %}
{{ m.icon("check" if step.ended and not step.failed else "triangle-alert" if step.failed else "terminal") }} {{ m.call(step.call) }} {{ m.about(step.call) }}{% if step.failed and step.error %} {{ step.error }}{% endif %} {% if not step.ended %}{{ (now_ms - step.at_ms) | duration("timer") }}{% elif step.call.duration_ms is not none %}{{ step.call.duration_ms | duration("compact") }}{% endif %}
{% endfor %} {% if turn.step in ("reply", "thinking") %}
{{ m.icon("sparkles") }} {{ t.text("activity.live." ~ turn.step) }} {{ (now_ms - turn.step_ms) | duration("timer") }}
{% endif %}
{{ t.text("activity.live.this_turn") }} {{ (turn.input + turn.cached) | tokens }} {{ t.text("activity.input") }} {{ t.text("activity.input") }} {{ (turn.input + turn.cached) | tokens }} {{ turn.output | tokens }} {{ t.text("activity.output") }} {{ t.text("activity.output") }} {{ turn.output | tokens }} {{ t.text("activity.hits") }} {{ m.hits(turn) }} {{ t.text("activity.live.called") }}{{ t.text("activity.live.tools") }} {{ turn.calls.total }} {{ t.text("activity.times") }}
{% endfor %}
{% endblock %}