{% from "_macros.html" import icon %}
{#
  The result of calling one tool by hand.

  What comes back is whatever the endpoint chose to send, which makes it exactly
  as untrusted as a search result or model output. It is shown escaped, inside a
  <pre>, and never rendered as Markdown.
#}
{% if error %}
<div class="alert alert--error">{{ icon("warning", "icon--sm") }} <span>{{ error }}</span></div>
{% else %}
<div class="alert alert--success">
  {{ icon("check", "icon--sm") }}
  <span>{{ detail or tool.slug }} answered.</span>
</div>
{% endif %}

{% if outcome %}
<p class="field__hint">This is what the model would read back:</p>
<pre class="tool-result__text">{{ outcome.content }}</pre>
{% endif %}
