WIP 2.0.0: the five AI helpers' API

src/ai/helpers.ts: instructions, schemas and inputs for draft event,
summarise report (people-free reports only), draft message, summarise
feedback (no names, access-logged) and improve text. Contact details
are swapped for placeholders before sending and restored after; every
helper gets today's date; weekday clashes and break-even over capacity
are checked in code. v2 routes /ai/draft-event and friends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 17:38:16 +02:00
co-authored by Claude Opus 5.5
parent cbdc7ad10a
commit d4f54f2cc8
7 changed files with 2423 additions and 1 deletions
+9
View File
@@ -24,6 +24,15 @@ and this project follows [Semantic Versioning](https://semver.org/).
operator register, switched off until a site uses AI. Migration `20261030120000_ai_helpers`.
- v2 errors have a new code, `UNAVAILABLE` (503), for when the Hub or the AI service can't be
reached.
- **The five AI helpers' API** (supervisors and admins): `POST /api/v2/ai/draft-event` (the event
form from a description, with ticket options, early bird, schedule and a budget from the notes),
`/ai/summarise-report` (reports without people in them only), `/ai/draft-message` (email or
WhatsApp, with `{{name}}` and the event placeholders), `/ai/summarise-feedback` (an event's
feedback, sent without who answered; recorded in the access log) and `/ai/improve-text`
(improve, shorter, or only fix mistakes). Every helper is told today's date. Email addresses,
phone numbers and ID numbers in what's sent are swapped for placeholders and put back in the
answer, so they never leave the site. Two checks are worked out in code as well as by the AI: a
weekday that doesn't match its date, and costs a full event can't cover.
## [1.51.17] - 2026-10-30 — security release