{% macro src_link(source) %}{{ source.name }}{% endmacro %} {% macro item_href(source, item_id) %}/s/{{ source.name|u }}/item/{{ (item_id if item_id is not none else AGENT_LEVEL)|u }}{% endmacro %} {% macro event_link(source, id) %}{% if id > 0 %}#{{ id }}{% else %}(no id){% endif %}{% endmacro %} {% macro flags(names) %}{% for f in names %}{{ f }}{% endfor %}{% endmacro %} {% macro turn_row(source, t) %}
turn {{ t.number }} {% if t.call.purpose %}{{ t.call.purpose }}{% endif %} {{ t.call.role or "" }} · {{ t.call.model }}{% if t.call.answered_by and t.call.answered_by != t.call.model %} → {{ t.call.answered_by }}{% endif %} · {{ "%.1f"|format(t.call.seconds) }}s · {{ t.call.tokens_in|num }} in / {{ t.call.tokens_out|num }} out {% if t.reused %} · reused {{ t.reused }}{% endif %} {% if t.call.outcome != "answered" %} · {{ t.call.outcome }}{% endif %} {{ flags(t.flags) }} {% for told in t.told %}
orchestrator: {{ told|clip(160) }}
{% endfor %}
{{ t.reply|reply_line|clip(240) }}
{% endmacro %} {% macro run_node(source, node) %}
{{ node.run.kind }} {{ node.run.role }} · {{ node.run.outcome or "running" }} · {{ node.run.started_at|when }} → {{ node.run.ended_at|when }} · {{ node.turns|length }} turns {% if node.run.note %} · {{ node.run.note|clip(160) }}{% endif %} {% for c in node.circles %}

Going in circles: {{ c.kind }} at turns {% for i in c.turns %}{{ i + 1 }}{% if not loop.last %}, {% endif %}{% endfor %}: {{ c.detail }}

{% endfor %} {% for kind, obj in node.entries %} {% if kind == "turn" %}{{ turn_row(source, obj) }}{% elif kind == "event" %}{{ step(source, obj) }}{% else %}{{ run_node(source, obj) }}{% endif %} {% endfor %}
{% endmacro %} {% macro step(source, e) %}
{{ event_link(source, e.id) }} {{ e.ts|when }} · {{ e.actor }} · {{ e.type|replace("_", " ") }}
{{ summary(e.type, e.payload)|clip(600) }}
{% endmacro %}