{% for group in hierarchical_events %}
{% if group.has_children %} {% else %} {% endif %} {% if group.parent.tool_name and group.parent.tool_name != 'UserQuery' %} {{ group.parent.tool_name }} {% endif %} {% if group.has_children %} ({{ group.total_count }}) {% endif %} {% set agent_lower = group.parent.agent_id|lower %} {% if agent_lower not in ['claude-code', 'claude_code', 'claude'] %} {% if agent_lower in ['gemini', 'copilot', 'openai'] %} {{ group.parent.agent_id }} {% else %} {{ group.parent.agent_id[:8] }} {% endif %} {% endif %} {% if group.parent.input_summary %} {{ group.parent.input_summary[:200] }}{% if group.parent.input_summary|length > 200 %}…{% endif %} {% elif group.parent.output_summary %} {{ group.parent.output_summary[:200] }}{% if group.parent.output_summary|length > 200 %}…{% endif %} {% endif %} {% if group.parent.cost_tokens or group.parent.execution_duration_seconds %} {% if group.parent.cost_tokens %}{{ group.parent.cost_tokens }}t{% endif %} {% if group.parent.execution_duration_seconds %} {{ "%.1f"|format(group.parent.execution_duration_seconds) }}s{% endif %} {% endif %}
{% if group.work_item_id %} {{ group.work_item_type | upper }} {{ group.work_item_id[-8:] }} {% else %} {% endif %} {{ group.parent.timestamp[11:19] if group.parent.timestamp|length >= 19 else group.parent.timestamp }} {# Render children inline (hidden by default) so idiomorph preserves them on morph #} {% if group.has_children %} {% for child in group.children %}
{% if child.children %} {% else %} {% endif %} {% if child.tool_name and child.tool_name != 'UserQuery' %} {{ child.tool_name }} {% endif %} {% if child.tool_name in ('Task', 'Agent') %} {% if child.subagent_type %} {% set agent_type = child.subagent_type | lower %} {% if 'researcher' in agent_type %} {% set badge_class = 'researcher-agent' %} {% elif 'haiku' in agent_type %} {% set badge_class = 'haiku-agent' %} {% elif 'opus' in agent_type %} {% set badge_class = 'opus-agent' %} {% elif 'test' in agent_type or 'debug' in agent_type %} {% set badge_class = 'green-agent' %} {% else %} {% set badge_class = 'claude-agent' %} {% endif %} {{ child.subagent_type }} {% endif %} {% if child.model %} {% set m = child.model %} {% if m.startswith('claude-') %}{% set m = m[7:] %}{% endif %} {% set parts = m.split('-') %} {% if parts|length == 3 %} {% set m = parts[0] + '-' + parts[1] + '.' + parts[2] %} {% elif parts|length == 2 %} {% set m = parts[0] + '-' + parts[1] %} {% endif %} {{ m }} {% endif %} {% endif %} {% if child.children %} ({{ child.total_count }}) {% endif %} {% if child.input_summary %} {{ child.input_summary[:200] }}{% if child.input_summary|length > 200 %}…{% endif %} {% elif child.output_summary %} {{ child.output_summary[:200] }}{% if child.output_summary|length > 200 %}…{% endif %} {% endif %} {% if child.cost_tokens or child.execution_duration_seconds %} {% if child.cost_tokens %}{{ child.cost_tokens }}t{% endif %} {% if child.execution_duration_seconds %} {{ "%.1f"|format(child.execution_duration_seconds) }}s{% endif %} {% endif %}
{{ child.timestamp[11:19] if child.timestamp|length >= 19 else child.timestamp }} {# Grandchildren (depth-2) #} {% if child.children %} {% for grandchild in child.children %}
{% if grandchild.children %} {% else %} {% endif %} {% if grandchild.tool_name and grandchild.tool_name != 'UserQuery' %} {{ grandchild.tool_name }} {% endif %} {% if grandchild.tool_name in ('Task', 'Agent') %} {% if grandchild.subagent_type %} {% set agent_type = grandchild.subagent_type | lower %} {% if 'researcher' in agent_type %} {% set badge_class = 'researcher-agent' %} {% elif 'haiku' in agent_type %} {% set badge_class = 'haiku-agent' %} {% elif 'opus' in agent_type %} {% set badge_class = 'opus-agent' %} {% elif 'test' in agent_type or 'debug' in agent_type %} {% set badge_class = 'green-agent' %} {% else %} {% set badge_class = 'claude-agent' %} {% endif %} {{ grandchild.subagent_type }} {% endif %} {% if grandchild.model %} {% set m = grandchild.model %} {% if m.startswith('claude-') %}{% set m = m[7:] %}{% endif %} {% set parts = m.split('-') %} {% if parts|length == 3 %} {% set m = parts[0] + '-' + parts[1] + '.' + parts[2] %} {% elif parts|length == 2 %} {% set m = parts[0] + '-' + parts[1] %} {% endif %} {{ m }} {% endif %} {% endif %} {% if grandchild.children %} ({{ grandchild.total_count }}) {% endif %} {% if grandchild.input_summary %} {{ grandchild.input_summary[:200] }}{% if grandchild.input_summary|length > 200 %}…{% endif %} {% elif grandchild.output_summary %} {{ grandchild.output_summary[:200] }}{% if grandchild.output_summary|length > 200 %}…{% endif %} {% endif %} {% if grandchild.cost_tokens or grandchild.execution_duration_seconds %} {% if grandchild.cost_tokens %}{{ grandchild.cost_tokens }}t{% endif %} {% if grandchild.execution_duration_seconds %} {{ "%.1f"|format(grandchild.execution_duration_seconds) }}s{% endif %} {% endif %}
{{ grandchild.timestamp[11:19] if grandchild.timestamp|length >= 19 else grandchild.timestamp }} {# Great-grandchildren (depth-3) #} {% if grandchild.children %} {% for ggchild in grandchild.children %}
{% if ggchild.tool_name and ggchild.tool_name != 'UserQuery' %} {{ ggchild.tool_name }} {% endif %} {% if ggchild.input_summary %} {{ ggchild.input_summary[:200] }}{% if ggchild.input_summary|length > 200 %}…{% endif %} {% elif ggchild.output_summary %} {{ ggchild.output_summary[:200] }}{% if ggchild.output_summary|length > 200 %}…{% endif %} {% endif %} {% if ggchild.cost_tokens or ggchild.execution_duration_seconds %} {% if ggchild.cost_tokens %}{{ ggchild.cost_tokens }}t{% endif %} {% if ggchild.execution_duration_seconds %} {{ "%.1f"|format(ggchild.execution_duration_seconds) }}s{% endif %} {% endif %}
{{ ggchild.timestamp[11:19] if ggchild.timestamp|length >= 19 else ggchild.timestamp }} {% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %}