{% extends "space-settings-base.html" %} {% from "ui.html" import action, csrf_field with context %} {% from "tidy-run-now.html" import run_now_button with context %} {% set section = "tidy" %} {% block section %} {# A run right away (its own POST form, outside the settings form), then the settings. #} {% if run_now %}
{{ _("Start a run without waiting for the night") }}

{{ _("The Tidy-up tab follows it and shows its result.") }}

{{ run_now_button("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/tidy", run_now.caution, run_now.paid, run_now.average_cost) }} {% if run_now.caution == 'failures' %}

{{ _("The last {n} runs failed: test the connection first.", n=run_now.failures) }}

{% elif run_now.caution == 'test' %}

{{ _("The last connection test failed: test it again before starting a run.") }} {{ _("Organization AI page") }}

{% endif %}
{% endif %} {# Two ways to trigger the tidy-up, each in its group, then the model. #}

{{ _("Every day at the chosen time, the AI agent files the inbox into the wiki. Space-specific instructions: the repository file .synaptane/prompts/tidy.md.") }}

{{ _("People who drop notes get an email when their notes are filed or left (can be turned off in My account).") }}

{% if not ai_configured %}

{{ _("No AI provider is configured for the organization.") }} {{ _("Configure") }}

{% endif %} {{ csrf_field() }}
{{ _("Daily tidy-up") }}
{% for zone in timezones %}

{{ _("Even with an empty inbox, the agent fixes the problems people introduced since the last run: broken links, new pages that nothing links to, missing from their folder's index, untitled or empty, and the team checks they break (blocking ones and personal data). At most {count} a night; it only costs when there are some.", count=max_problems) }}

{{ _("Tidy-up as you go") }}

{{ _("Notes dropped during this delay are tidied together, in a single run. The monthly budget applies.") }}

{{ _("The night and its report") }}

{{ _("Routines whose schedule is “night” run at the tidy-up's time, just before or after it, one after the other. After the night, one report: what was filed and fixed, each routine's status and report, failures and their cause, the cost.") }}

{% if night_routines %}
    {% for r in night_routines %}
  1. {{ r.title or r.name }} ({{ _("before the tidy-up") if r.night == 'before' else _("after the tidy-up") }}{% if not r.enabled %}, {{ _("Disabled", context="routine") }}{% endif %})
  2. {% endfor %}
{% else %}

{{ _("No routine of the night yet: give a routine the schedule “night” (Settings → Routines).") }}

{% endif %}

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

{{ _("Stored encrypted, never shown again and never written to the repository. Mattermost and other Slack-compatible webhooks work too.") }}

{% if report.webhook %}

{{ _("Slack webhook configured") }}

{% endif %}

{{ _("Otherwise a quiet night (nothing filed, fixed or run, no failure) sends nothing.") }}

{% if report.active %}
{{ _("Try the report") }}

{{ _("The last night's report, marked as a test: by email to you only, and to the Slack webhook.") }}

{{ action("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/night-report/test", _("Send a test report")) }}
{% endif %} {% endblock %}