{% extends "base.html" %} {% from "_rows.html" import source_label, hhmm, hhmmss %} {% block title %}Session {{ session }}{% endblock %} {#- The text a body shows: its ``text``, a tool result's ``content``, else its JSON. -#} {% macro text_into(ns, body) -%} {%- if body is mapping and body.text is defined and body.text is string -%} {%- set ns.text = body.text -%} {%- elif body is mapping and body.content is defined and body.content is string -%} {%- set ns.text = body.content -%} {%- elif body is mapping and body.content is defined and body.content is iterable -%} {%- set ns.text = body.content | select('mapping') | selectattr('type', 'equalto', 'text') | map(attribute='text') | select('string') | join('\n') -%} {%- else -%} {%- set ns.text = body | full_text -%} {%- endif -%} {%- endmacro %} {#- A decision as the person reads it: allowed by a rule, asked and approved, or denied. -#} {% macro verdict(d) -%} {%- set b = d.body if d.body is mapping else {} -%} {%- set source = b.source if b.source is string else '' -%} {%- if b.decision == 'accept' -%} {%- set label = 'asked' if source.startswith('user') else 'allowed' -%} {%- elif b.decision == 'reject' -%} {%- set label = 'denied' -%} {%- else -%} {%- set label = b.decision | string -%} {%- endif -%} {{ label }} {%- endmacro %} {% macro tokens(text) -%} {%- set n = (text | length / 4) | round(0, 'ceil') | int -%} {%- if n >= 1000 %}~{{ '%.1f' | format(n / 1000) }}k{% else %}~{{ n }}{% endif %} tokens {%- endmacro %} {% macro load_full(key) -%} load full {%- endmacro %} {% macro long_body(text, key) -%}
{{ text[:preview_chars] }}
{% if text | length > preview_chars and key %}
{{ load_full(key) }}
{% endif %}
{%- endmacro %}
{% macro when(n) -%}
{%- endmacro %}
{% macro steps(n) -%}
{{ session }}
This session is incomplete: the record has not yet answered every entry it holds for it.
{% endif %} {% if newer_href %}Entries arrived after this page was read. Read from the start
{% endif %}