From 9aa06ae8942a1b45f370eedca76e7d796bf4530c Mon Sep 17 00:00:00 2001 From: Joshua Oosthuizen Date: Tue, 17 Nov 2026 11:38:33 +0200 Subject: [PATCH] Docs: token AI status is shown from Cross Events 2.2.0 (was planned for 2.3.0) Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- backend/src/utils/ai.js | 2 +- docs/hub-protocol.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9154f9e..814ca07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ versions follow [Semantic Versioning](https://semver.org/). the `status` in every AI reply) also carries `usedInputTokens` / `usedOutputTokens` (this month, all the church's installs) and `capInputTokens` / `capOutputTokens`, an estimate of the allowance (half the cap priced as input and half as output, at the current model price, exchange rate and - markup). Cross Events 2.3.0 shows only these and the percentage; rand stays on the Hub. The cents + markup). Cross Events 2.2.0 shows only these and the percentage; rand stays on the Hub. The cents fields are unchanged, so older installs keep working (protocol §3b). ### Changed diff --git a/backend/src/utils/ai.js b/backend/src/utils/ai.js index 488d7af..3ed775b 100644 --- a/backend/src/utils/ai.js +++ b/backend/src/utils/ai.js @@ -117,7 +117,7 @@ function allowanceTokens(capCents, price) { * - enabled false → hidden (cap R0, licence not active, or the Hub's AI not set up); * - capReached → shown but disabled until `renewsOn` or until the cap is raised. * `used` is this month's use from usedThisMonth. The cents stay for installs older than Events - * 2.3.0; newer ones show only tokens and the percentage. + * 2.2.0; newer ones show only tokens and the percentage. */ function statusOf({ licence, price, used, now = new Date() }) { const chargedMillicents = used?.chargedMillicents || 0; diff --git a/docs/hub-protocol.md b/docs/hub-protocol.md index 5674075..0fa23f9 100644 --- a/docs/hub-protocol.md +++ b/docs/hub-protocol.md @@ -214,14 +214,14 @@ X-Hub-Install / X-Hub-Timestamp / X-Hub-Signature (as in §3) active (suspended, revoked, or past its grace days), or the Hub's AI isn't set up. - **`capReached: true`** — show the buttons **disabled** ("This month's AI allowance is used up — it renews on 1 December"). Reached means there isn't room left for even a small call. -- **Churches see tokens, never rand** (Hub 2.0.1, Cross Events 2.3.0). `usedInputTokens` / +- **Churches see tokens, never rand** (Hub 2.0.1, Cross Events 2.2.0). `usedInputTokens` / `usedOutputTokens` are this month's tokens over all the church's installs (input counts cached prompt tokens). `capInputTokens` / `capOutputTokens` are an **estimate** of the allowance: what half the cap buys as input and half as output, at the current model price, exchange rate and markup, rounded down to a thousand. `usedPercent` is exact (it's worked out in rand). Installs show the tokens and the percentage, and don't pass the cents on. - `capCents` / `usedCents` are cents (rand) as **charged** to the church, with fractions (a call costs - a fraction of a cent), for the Hub and for installs before Cross Events 2.3.0. The month is South + a fraction of a cent), for the Hub and for installs before Cross Events 2.2.0. The month is South African time; `renewsOn` is the 1st of the next month. ### A helper call