{% import "components.html" as c with context %} {% import "agent_form.html" as f with context %} {# the agent as its computer holds it, one page of cards under headings; saved, it comes back as the computer now holds it #} {% set base = "/agents/" ~ ref(selected.computer_id) ~ "/" ~ ref(selected.id) ~ "/profile" %} {% if values is none %}

{{ t.text("agents." ~ held.answer, {"code": held.code}) if held.answer != "listed" else t.text("agents.gone") }}

{% else %} {% set channels = values.get("channel", []) %} {% set runtimes = values.get("runtime", []) %}
{{ t.text("agents.step.basic") }}
{{ f.basic(values) }}
{{ t.text("contacts.reply") }}
{{ f.reply(reply) }}
{{ t.text("agents.step.channels") }}
{{ f.deck("channel", channels, 0, kept=true, origins=origins.channel if origins is defined and origins else none, present=values.get("secrets", ())) }}
{{ t.text("agents.step.runtimes") }}
{{ f.deck("runtime", runtimes, channels|length, kept=true, origins=origins.runtime if origins is defined and origins else none) }} {% if failed %}

{{ t.text("agents." ~ failed.partition(":")[0], {"code": failed.partition(":")[2] or none}) }}

{% endif %} {% if saved %}

{{ t.text("agents.saved") }}

{% endif %}
{{ f.script() }}
{% endif %}

{{ t.text("agents.remove") }}

{{ t.text("agents.remove_hint") }}

{% if saved %}{% with name = head.name, selected = head, oob = true %}{% include "agent_profile_head.html" %}{% endwith %}{% endif %}