{% extends "space-settings-base.html" %} {% from "icons.html" import icon %} {% from "ui.html" import csrf_field, secret_confirm with context %} {% set section = "routines" %} {% set base = "/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/routines" %} {% block section %}

{{ icon('chevron-left', 14) }}{{ routine.title if routine else _("All routines") }}

{# Day of the week or of the month: only the one for the chosen frequency is shown (CSS :has, no script); without :has, both stay visible and the other one is ignored. #}

{% if routine %}{{ _("Edit the routine") }}{% elif draft.template %}{{ _("New routine from a template") }}{% else %}{{ _("New routine") }}{% endif %}

{% if error %}{% endif %} {% if routine and routine_error(routine) %}

{{ _("The routine's file is invalid: {error}", error=_(routine_error(routine))) }} {{ _("Saving replaces it with these settings.") }}

{% endif %} {{ csrf_field() }} {% if routine %} {% else %}{% endif %} {% if conflict_sha %}{% endif %} {{ secret_confirm(error) }}
{% if routine %}

{{ _("File in the repository: {path}", path=routine_path(routine)) }}

{% else %}

{{ _("The routine is the file .synaptane/routines/.md of the repository. Lowercase letters, digits and dashes; empty: made from the title.") }}

{% endif %}

{{ _("What the agent must do, and what its output must contain. It reads the wiki without being able to change it; what it reads cannot change these instructions.") }}

{{ _("Schedule") }}

{{ _("Local time of the space ({tz}), the same as the tidy-up.", tz=space.tidy_timezone) }}

{{ _("In the night: the routine runs at the tidy-up's time ({time}), just before or after it, and the night's report says what it did. The time above is then unused.", time=space.tidy_time) }}

{{ _("Scope") }}

{{ _("The agent only reads these folders: tree, pages, search and backlinks.") }}

{{ _("The agent may create, rewrite, move and delete pages there (Markdown; {pages} pages and {deletions} deletions per run at most), in one commit with its report. It reads them even outside the scope, and writes nowhere else. Never the whole wiki nor .synaptane/.", pages=max_written, deletions=max_deletions) }}

{{ _("External sources") }} {% set known = space_sources|map(attribute="name")|list %} {% for source in space_sources %}{% endfor %} {% for name in draft.sources if name not in known %}{% endfor %} {% if not space_sources and not draft.sources %}

{{ _("No external source in this space.") }} {{ _("Add one") }}

{% endif %}

{{ _("The agent reads the ticked sources over HTTP with the fetch tool (GET only), under their address. Synaptane adds the secret: the agent never sees it.") }}

{{ _("Outputs") }}

{{ _("Besides the folders it keeps, the routine writes nowhere else. Fixes to the wiki go through the inbox, which the tidy-up handles with its safeguards.") }}

{{ _("Verified addresses only; anyone can unsubscribe in My account.") }}

{{ _("Memory") }}

{{ _("The routine notes what its next runs should know (topics already reported, pages to follow), in .synaptane/memory/.md: a short text, read again at every run, which costs a few tokens.") }}

{{ _("Cancel") }}
{% endblock %}