{% import "macros.html" as ui %} {# AGENT's pages, at /agent/: the planner (plans → features → tasks, drawn as a graph) and the notes (guidelines, memory). Buttons open modals (/agent/form); every form posts to /agent/, which calls the same methods as the MCP tools, with the source "wiki", and returns this page redrawn. #} {% macro open_form(query, label, extra="") -%} {%- endmacro %}
{% set page = sections.agent.pages | selectattr("name", "equalto", tab) | first %} {{ ui.view_header("notes", "AGENT :: " ~ page.title, page.text ~ " Agents do it through the MCP tools; you can do it here, with the same functions.") }} {% if error %}

{{ error }}

{% endif %} {% if tab == "planner" %} {# Plans on top: a click adds a plan to the chosen ones or takes it out. #} {% include "notes_cards.html" %} {# The chosen plans; beside them, inside the drawing's area, the plan, feature or task clicked (the first chosen plan at first). #} {% set details %}

{% if selected %}Loading…{% else %}Choose a plan above.{% endif %}

{% endset %}
{% call ui.view_canvas("planner", data_url, panel=details) %} {% for level in ("plan", "feature", "task") %}{{ level }}{% endfor %} {% for state, label in (("todo", "to do"), ("doing", "in progress"), ("blocked", "blocked"), ("late", "late"), ("done", "done")) %} {{ label }} {% endfor %} waits for (hover: why) {% endcall %}
{% else %}
{{ open_form("kind=note&type=" ~ note_groups[tab][0], "New note", "primary") }}
{# What the group is for; the ? opens, on hover, when to write each type, with an example. #}
{% for name in note_groups[tab] %}
{{ name }}
{{ note_types[name] }} {{ note_type_uses[name][0] }}E.g. “{{ note_type_uses[name][1] }}”
{% endfor %}
{{ not_a_note }}
{{ note_group_texts[tab][0] }} {{ note_group_texts[tab][1] }}
{# Left: the notes of the group as a tree (types, then their notes); right: the note clicked. #}
{% include "notes_tree.html" %}
{% endif %}