{#- The polled region of /tokens (#refresh-region): htmx re-fetches the view every 5s and the alpine-morph extension morphs the fresh fragment over the region in place. The route renders THIS template alone on an HX-Request (a poll is a cheap region render, never a full page). There is no filter form here, so the view's current params are baked into the region's hx-get URL — each poll re-requests exactly the slice the page rendered. -#} {% import "_links.html" as links with context %} {% import "_table.html" as tables with context %} {% import "_cards.html" as cards with context %} {%- set token_q = {} %} {%- if window != "all" %}{% set token_q = token_q | merge({'window': window}) %}{% endif %}
Estimation mode: {{ tools_meta.token_mode }}{% if tools_meta.calibrated %} — calibrated at ~{{ tools_meta.chars_per_token }} chars/token from this window's stored summaries{% elif 'heuristic' not in tools_meta.token_mode %} — uncalibrated for this window; estimates use the {{ tools_meta.chars_per_token }} chars/token heuristic divisor{% endif %}.
{% include "window_control.html" %} {#- Exports ride the view's current filters (the selected store rides links.url). -#} {%- set export_q = {} %} {%- if window != "all" %}{% set export_q = export_q | merge({'window': window}) %}{% endif %} {% if tools %} {{ cards.stat_row([ {"value": tools | length, "label": "tools"}, {"value": tools | map(attribute='calls') | sum, "label": "calls"}, {"value": "~" ~ (tools | map(attribute='total_tokens') | sum), "label": "est. tokens total"}, ]) }} {% call tables.table(['Tool', 'Calls', 'Est. req tokens', 'Est. resp tokens', 'Total est. tokens', 'Mean est. tokens', 'Truncated calls', 'Chars cut']) %} {% for t in tools %}