From a5c4fdc128e1be22afc82b98f127a265a917bdbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Tue, 10 Nov 2026 14:05:38 +0000 Subject: [PATCH] Contract at server dev e0c2332; the update check asks the instance first (GET /api/v2/apps) Re-pinned at e0c2332 (after 2a2b24f /apps, 57d06ee schedules on a computer, e0c2332 force_tool on POST /chats): apps.json, apps_stable.json, schedule_on_device.json; `runs_on` on schedules (parsed by the rest, not drawn yet); the schedules frame's version hash. ReleaseCheck: the instance's recommendation first (it knows which release speaks its /api/v2); a beta only with Include betas; a null android means no offer. A server without the route, none signed in or none reachable falls back to GitHub's list as before. The About line says so (8 translations). UpdateCheckTest reads both fixtures. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 6 +- .../java/eu/llembas/android/api/ApiClient.kt | 3 + .../java/eu/llembas/android/api/Models.kt | 16 +++ .../eu/llembas/android/update/ReleaseCheck.kt | 26 ++++- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- .../java/eu/llembas/android/ContractTest.kt | 8 ++ .../llembas/android/ScheduleContractTest.kt | 2 +- .../eu/llembas/android/UpdateCheckTest.kt | 21 ++++ contract/apps.json | 20 ++++ contract/apps_stable.json | 15 +++ contract/event_schedules.json | 3 +- contract/lock.json | 6 +- contract/schedule.json | 1 + contract/schedule_on_device.json | 98 +++++++++++++++++++ contract/schedule_watching.json | 2 + contract/schedules.json | 1 + scripts/strings.py | 2 +- scripts/strings_own.json | 16 +-- 26 files changed, 237 insertions(+), 27 deletions(-) create mode 100644 contract/apps.json create mode 100644 contract/apps_stable.json create mode 100644 contract/schedule_on_device.json diff --git a/CHANGELOG.md b/CHANGELOG.md index d9b36b8..a2dd58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,9 @@ is in alpha and releases come off `main`. ### Added - **The app tells you when a newer version is out.** Settings › About › *Look for new versions*: - at most once a day, when the app starts, it reads the public list of LLeMbas for Android - releases on GitHub (plain HTTPS, no Google service, nothing about you sent) and, when there is - a newer one, says so in a notification that opens the release's page with its APKs. On by + at most once a day, when the app starts, it asks your instance which release goes with it + (an instance older than that reads the public list of LLeMbas for Android releases on GitHub; + plain HTTPS, no Google service, nothing about you sent) and, when there is a newer one, says so in a notification that opens the release's page with its APKs. On by default in a beta, off in a release. *Include betas* offers test versions too (on by default in a beta). **Check for an update** asks at once, in either build; the full build can then install a release itself. diff --git a/app/src/main/java/eu/llembas/android/api/ApiClient.kt b/app/src/main/java/eu/llembas/android/api/ApiClient.kt index f2c3630..99d4b02 100644 --- a/app/src/main/java/eu/llembas/android/api/ApiClient.kt +++ b/app/src/main/java/eu/llembas/android/api/ApiClient.kt @@ -171,6 +171,9 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli /** The folder and the folders inside it; their chats fall back to no folder. */ suspend fun deleteFolder(id: String) = empty(authed("$v2/folders/${segment(id)}").delete().build()) + /** The app releases this server recommends; 404 from a server older than the route. */ + suspend fun apps(): AppsInfo = get("/apps") + /** The web's search in JSON: chats by their words (and meaning, where indexed), files, memories. */ suspend fun search(q: String, within: String = "all", limit: Int = 20): SearchResults = get("/search?q=${segment(q)}&in=${segment(within)}&limit=$limit") diff --git a/app/src/main/java/eu/llembas/android/api/Models.kt b/app/src/main/java/eu/llembas/android/api/Models.kt index 2e3dd4d..e432c28 100644 --- a/app/src/main/java/eu/llembas/android/api/Models.kt +++ b/app/src/main/java/eu/llembas/android/api/Models.kt @@ -220,6 +220,22 @@ data class SearchResults( fun hits(kind: String): List = results.firstOrNull { it.kind == kind }?.hits.orEmpty() } +/** One app release the server recommends (`GET /api/v2/apps`), with the page its files are on. */ +@Serializable +data class AppRelease(val version: String = "", val tag: String = "", val channel: String = "", val page: String = "") + +@Serializable +data class ServerChannel(val version: String = "", val channel: String = "") + +/** + * Which release of each app goes with this server: a stable server names only a stable app, a + * beta server the newer of the app's stable and beta. Null for an app it recommends none of. + */ +@Serializable +data class AppsInfo(val server: ServerChannel = ServerChannel(), val apps: Map = emptyMap()) { + val android: AppRelease? get() = apps["android"] +} + /** A data group: whose records a memory is kept among. */ @Serializable data class DataGroup(val id: String = "", val name: String = "") diff --git a/app/src/main/java/eu/llembas/android/update/ReleaseCheck.kt b/app/src/main/java/eu/llembas/android/update/ReleaseCheck.kt index c6b846a..ad62d35 100644 --- a/app/src/main/java/eu/llembas/android/update/ReleaseCheck.kt +++ b/app/src/main/java/eu/llembas/android/update/ReleaseCheck.kt @@ -13,6 +13,7 @@ import androidx.core.content.ContextCompat import eu.llembas.android.BuildConfig import eu.llembas.android.LembasApp import eu.llembas.android.R +import eu.llembas.android.api.AppsInfo import eu.llembas.android.api.LembasJson import eu.llembas.android.api.SharedHttp import eu.llembas.android.api.await @@ -79,7 +80,9 @@ sealed interface UpdateResult { } /** - * The update check: the public releases of the app on GitHub, read over plain HTTPS -- no + * The update check: the release the instance recommends (`GET /api/v2/apps`), which knows what + * speaks its API; from a server without that, the public releases of the app on GitHub, read + * over plain HTTPS -- no * Google service, no account, nothing sent but the request itself. It runs when the app starts, * at most once a day and only while Settings › About › *Look for new versions* is on (on by * default in a beta, off in a release), and when the person taps *Check for an update*. A newer @@ -92,6 +95,13 @@ class ReleaseCheck(private val context: Context) { suspend fun check(): UpdateResult = withContext(Dispatchers.IO) { val prefs = context.lembas.instances.prefs.first() val installed = AppVersion.parse(BuildConfig.VERSION_NAME) ?: return@withContext UpdateResult.Current + // The instance first: it knows which release speaks its /api/v2. Only a server without + // the route (or none signed in, or none reachable) leaves it to GitHub's list. + val server = runCatching { context.lembas.instances.client()?.apps() }.getOrNull() + if (server != null) { + return@withContext recommended(server, installed, prefs.offersBetas(installed.isBeta)) + ?.let { UpdateResult.Newer(it) } ?: UpdateResult.Current + } try { val releases = SharedHttp.newCall( Request.Builder().url(RELEASES).header("Accept", "application/vnd.github+json").build(), @@ -161,6 +171,20 @@ class ReleaseCheck(private val context: Context) { .maxByOrNull { (v, _) -> v } ?.let { (v, r) -> UpdateOffer(v, r.page.ifBlank { "$REPOSITORY/releases/tag/${r.tag}" }) } + /** + * The server's recommendation, when it is newer than [installed] and may be offered: a + * beta only with [betas]. None recommended (null) is no offer -- the server knows no + * Android release that speaks its API, so none is pushed. + */ + fun recommended(info: AppsInfo, installed: AppVersion, betas: Boolean): UpdateOffer? { + val app = info.android ?: return null + val version = AppVersion.parse(app.version) ?: return null + if (version.isBeta && !betas) return null + if (version <= installed) return null + val tag = app.tag.ifBlank { "v$version" } + return UpdateOffer(version, app.page.takeIf { it.startsWith("https://") } ?: "$REPOSITORY/releases/tag/$tag") + } + fun due(last: Long, now: Long): Boolean = last <= 0 || now - last >= DAY_MS || now < last fun open(url: String): Intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index b77be07..22464a2 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -351,7 +351,7 @@ Je k dispozici %1$s. Klepnutím otevřete stránku vydání. Nainstalovat %1$s Hledat nové verze - Nejvýš jednou denně, při spuštění, si aplikace přečte z GitHubu seznam vydání LLeMbas pro Android a upozorněním vám dá vědět, když je k dispozici novější. Nic o vás ani o vaší instanci se neposílá. Ve verzi beta zapnuto, jinak vypnuto. + Nejvýš jednou denně, při spuštění, se aplikace zeptá vaší instance, které vydání k ní patří (u starší instance si přečte seznam vydání na GitHubu), a upozorněním vám dá vědět, když je k dispozici novější. Nic o vás se nikam jinam neposílá. Ve verzi beta zapnuto, jinak vypnuto. Včetně beta verzí Nabízet i testovací verze, nejen vydání. Zapnuto, když je tato aplikace sama beta. Aktualizace aplikace diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 47184e5..0c58436 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -351,7 +351,7 @@ %1$s ist verfügbar. Tippen Sie, um die Release-Seite zu öffnen. %1$s installieren Nach neuen Versionen suchen - Höchstens einmal am Tag, beim Start, liest die App die Liste der Releases von LLeMbas für Android auf GitHub und meldet per Benachrichtigung, wenn es eine neuere gibt. Nichts über Sie oder Ihre Instanz wird gesendet. In einer Beta standardmäßig an, sonst aus. + Höchstens einmal am Tag, beim Start, fragt die App Ihre Instanz, welches Release zu ihr passt (bei einer älteren Instanz: die Liste der Releases auf GitHub), und meldet per Benachrichtigung, wenn es ein neueres gibt. Nichts über Sie wird anderswohin gesendet. In einer Beta standardmäßig an, sonst aus. Betas einbeziehen Auch Testversionen anbieten, nicht nur Releases. Standardmäßig an, wenn diese App selbst eine Beta ist. App-Updates diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d439636..c4aa4e3 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -351,7 +351,7 @@ %1$s está disponible. Toque para abrir su página de publicación. Instalar %1$s Buscar nuevas versiones - Como mucho una vez al día, al iniciarse, la aplicación lee en GitHub la lista de versiones de LLeMbas para Android y le avisa con una notificación cuando hay una más reciente. No se envía nada sobre usted ni sobre su instancia. Activado por defecto en una beta; si no, desactivado. + Como mucho una vez al día, al iniciarse, la aplicación pregunta a su instancia qué versión le corresponde (con una instancia más antigua, lee la lista de versiones en GitHub) y le avisa con una notificación cuando hay una más reciente. No se envía nada sobre usted a ningún otro sitio. Activado por defecto en una beta; si no, desactivado. Incluir betas Ofrecer también versiones de prueba, no solo publicaciones. Activado por defecto cuando esta aplicación es una beta. Actualizaciones de la aplicación diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ab051ac..b89ac2c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -351,7 +351,7 @@ %1$s est disponible. Touchez pour ouvrir sa page de publication. Installer %1$s Rechercher de nouvelles versions - Au plus une fois par jour, au démarrage, l’application lit sur GitHub la liste des versions de LLeMbas pour Android et vous prévient par une notification lorsqu’il en existe une plus récente. Rien sur vous ni sur votre instance n’est envoyé. Activé par défaut dans une bêta, désactivé sinon. + Au plus une fois par jour, au démarrage, l’application demande à votre instance quelle version lui correspond (avec une instance plus ancienne, elle lit la liste des versions sur GitHub) et vous prévient par une notification lorsqu’il en existe une plus récente. Rien sur vous n’est envoyé ailleurs. Activé par défaut dans une bêta, désactivé sinon. Inclure les bêtas Proposer aussi les versions de test, pas seulement les publications. Activé par défaut quand cette application est elle-même une bêta. Mises à jour de l’application diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 8f393ef..a4d842f 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -351,7 +351,7 @@ Elérhető a(z) %1$s. Koppintson a kiadás oldalának megnyitásához. %1$s telepítése Új verziók keresése - Naponta legfeljebb egyszer, induláskor az alkalmazás beolvassa a GitHubról a LLeMbas Androidra kiadásainak listáját, és értesítésben jelzi, ha van újabb. Önről és a példányáról semmit sem küld. Béta verzióban alapból bekapcsolva, egyébként kikapcsolva. + Naponta legfeljebb egyszer, induláskor az alkalmazás megkérdezi a példányát, melyik kiadás illik hozzá (régebbi példánynál a GitHubon lévő kiadások listáját olvassa be), és értesítésben jelzi, ha van újabb. Önről semmi nem megy máshová. Béta verzióban alapból bekapcsolva, egyébként kikapcsolva. Béták is Tesztverziók felajánlása is, nem csak kiadásoké. Alapból bekapcsolva, ha ez az alkalmazás maga is béta. Alkalmazásfrissítések diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 68fe2a8..aae840b 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -351,7 +351,7 @@ %1$s è disponibile. Tocca per aprire la pagina della release. Installa %1$s Cerca nuove versioni - Al massimo una volta al giorno, all’avvio, l’app legge da GitHub l’elenco delle release di LLeMbas per Android e la avvisa con una notifica quando ce n’è una più recente. Non viene inviato nulla su di lei o sulla sua istanza. Attivo per impostazione predefinita in una beta, altrimenti disattivato. + Al massimo una volta al giorno, all’avvio, l’app chiede alla sua istanza quale release le corrisponde (con un’istanza più vecchia, legge l’elenco delle release su GitHub) e la avvisa con una notifica quando ce n’è una più recente. Nulla su di lei viene inviato altrove. Attivo per impostazione predefinita in una beta, altrimenti disattivato. Includi le beta Offri anche le versioni di prova, non solo le release. Attivo per impostazione predefinita quando questa app è essa stessa una beta. Aggiornamenti dell’app diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 5853320..3e0a1ac 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -351,7 +351,7 @@ Dostępna jest wersja %1$s. Dotknij, aby otworzyć jej stronę wydania. Zainstaluj %1$s Szukaj nowych wersji - Najwyżej raz dziennie, przy uruchomieniu, aplikacja odczytuje z GitHuba listę wydań LLeMbas na Androida i daje znać powiadomieniem, gdy jest nowsza. Nic o tobie ani o twojej instancji nie jest wysyłane. W wersji beta domyślnie włączone, w przeciwnym razie wyłączone. + Najwyżej raz dziennie, przy uruchomieniu, aplikacja pyta twoją instancję, które wydanie do niej pasuje (przy starszej instancji odczytuje listę wydań z GitHuba), i daje znać powiadomieniem, gdy jest nowsze. Nic o tobie nie jest wysyłane nigdzie indziej. W wersji beta domyślnie włączone, w przeciwnym razie wyłączone. Uwzględniaj bety Proponuj też wersje testowe, nie tylko wydania. Domyślnie włączone, gdy ta aplikacja sama jest betą. Aktualizacje aplikacji diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 7583db9..1e50ce7 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -351,7 +351,7 @@ Je dostupná %1$s. Ťuknutím otvoríte stránku vydania. Nainštalovať %1$s Hľadať nové verzie - Najviac raz denne, pri spustení, si aplikácia prečíta z GitHubu zoznam vydaní LLeMbas pre Android a upozornením vám dá vedieť, keď je dostupná novšia. Nič o vás ani o vašej inštancii sa neposiela. V beta verzii zapnuté, inak vypnuté. + Najviac raz denne, pri spustení, sa aplikácia opýta vašej inštancie, ktoré vydanie k nej patrí (pri staršej inštancii si prečíta zoznam vydaní na GitHube), a upozornením vám dá vedieť, keď je dostupné novšie. Nič o vás sa nikam inam neposiela. V beta verzii zapnuté, inak vypnuté. Vrátane beta verzií Ponúkať aj testovacie verzie, nielen vydania. Zapnuté, keď je táto aplikácia sama beta. Aktualizácie aplikácie diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 26105af..3798f90 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -353,7 +353,7 @@ %1$s is available. Tap to open its release page. Install %1$s Look for new versions - At most once a day, when the app starts, it reads the list of LLeMbas for Android releases from GitHub and tells you in a notification when there is a newer one. Nothing about you or your instance is sent. On by default in a beta, off otherwise. + At most once a day, when the app starts, it asks your instance which release goes with it (an older instance: the list of releases on GitHub) and tells you in a notification when there is a newer one. Nothing about you is sent anywhere else. On by default in a beta, off otherwise. Include betas Offer test versions as well as releases. On by default when this app is itself a beta. App updates diff --git a/app/src/test/java/eu/llembas/android/ContractTest.kt b/app/src/test/java/eu/llembas/android/ContractTest.kt index 84037dd..1d16217 100644 --- a/app/src/test/java/eu/llembas/android/ContractTest.kt +++ b/app/src/test/java/eu/llembas/android/ContractTest.kt @@ -84,6 +84,14 @@ class ContractTest { assertTrue(found.results.first().more) } + @Test + fun aScheduleThatRunsOnAComputer() { + val schedule = LembasJson.parseToJsonElement(text("schedule_on_device")).jsonObject + // Parsed by the app's model without a field for it yet: the rest must still read. + assertEquals("sched3", read("schedule_on_device", eu.llembas.android.api.ScheduleEnvelope.serializer()).schedule.id) + assertTrue("runs_on" in schedule.getValue("schedule").jsonObject) + } + @Test fun theVersionIsOneThisAppReads() { val version = LembasJson.parseToJsonElement(text("version")).toString() diff --git a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt index fe07acc..ece8555 100644 --- a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt +++ b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt @@ -86,7 +86,7 @@ class ScheduleContractTest { assertWaybread(read("schedules", ScheduleList.serializer()).schedules.single()) assertWaybread(read("schedule", ScheduleEnvelope.serializer()).schedule) val frame = read("event_schedules", SchedulesFrame.serializer()) - assertEquals("d2f307bf1c7b8d6b", frame.version) + assertEquals("8bee85746004dc19", frame.version) assertWaybread(frame.schedules.single()) } diff --git a/app/src/test/java/eu/llembas/android/UpdateCheckTest.kt b/app/src/test/java/eu/llembas/android/UpdateCheckTest.kt index 5abc7ee..82b2d7e 100644 --- a/app/src/test/java/eu/llembas/android/UpdateCheckTest.kt +++ b/app/src/test/java/eu/llembas/android/UpdateCheckTest.kt @@ -1,5 +1,6 @@ package eu.llembas.android +import eu.llembas.android.api.AppsInfo import eu.llembas.android.api.LembasJson import eu.llembas.android.auth.Prefs import eu.llembas.android.update.AppVersion @@ -77,4 +78,24 @@ class UpdateCheckTest { // A clock set back is not a reason to wait a year. assertTrue(ReleaseCheck.due(10 * day, day)) } + + @Test + fun theServersRecommendationComesFirst() { + fun read(name: String) = LembasJson.decodeFromString( + AppsInfo.serializer(), + requireNotNull(javaClass.classLoader!!.getResource("$name.json")).readText(), + ) + val beta = read("apps") + assertEquals("1.1.0-beta.2", beta.android!!.version) + val offer = ReleaseCheck.recommended(beta, v("1.0.0-beta.5"), betas = true)!! + assertEquals("1.1.0-beta.2", offer.version.toString()) + assertEquals("https://github.com/LLeMbas/LLeMbas-Android/releases/tag/v1.1.0-beta.2", offer.page) + // A beta is not offered to someone who did not want betas, nor anything not newer. + assertNull(ReleaseCheck.recommended(beta, v("1.0.0-beta.5"), betas = false)) + assertNull(ReleaseCheck.recommended(beta, v("1.1.0-beta.2"), betas = true)) + // A stable server with no Android pin recommends nothing, so nothing is offered. + val stable = read("apps_stable") + assertNull(stable.android) + assertNull(ReleaseCheck.recommended(stable, v("1.0.0-beta.5"), betas = true)) + } } diff --git a/contract/apps.json b/contract/apps.json new file mode 100644 index 0000000..da8c92c --- /dev/null +++ b/contract/apps.json @@ -0,0 +1,20 @@ +{ + "server": { + "version": "2.1.0-beta.3", + "channel": "beta" + }, + "apps": { + "android": { + "version": "1.1.0-beta.2", + "tag": "v1.1.0-beta.2", + "channel": "beta", + "page": "https://github.com/LLeMbas/LLeMbas-Android/releases/tag/v1.1.0-beta.2" + }, + "desktop": { + "version": "1.0.1", + "tag": "v1.0.1", + "channel": "stable", + "page": "https://github.com/LLeMbas/LLeMbas-Desktop/releases/tag/v1.0.1" + } + } +} diff --git a/contract/apps_stable.json b/contract/apps_stable.json new file mode 100644 index 0000000..45cb069 --- /dev/null +++ b/contract/apps_stable.json @@ -0,0 +1,15 @@ +{ + "server": { + "version": "2.0.0", + "channel": "stable" + }, + "apps": { + "android": null, + "desktop": { + "version": "1.0.1", + "tag": "v1.0.1", + "channel": "stable", + "page": "https://github.com/LLeMbas/LLeMbas-Desktop/releases/tag/v1.0.1" + } + } +} diff --git a/contract/event_schedules.json b/contract/event_schedules.json index 19b480d..662d565 100644 --- a/contract/event_schedules.json +++ b/contract/event_schedules.json @@ -1,5 +1,5 @@ { - "version": "d2f307bf1c7b8d6b", + "version": "8bee85746004dc19", "schedules": [ { "id": "sched1", @@ -52,6 +52,7 @@ "fired_count": 3, "failure_streak": 0, "watch": null, + "runs_on": null, "last_error": null, "last_run": { "id": "run1", diff --git a/contract/lock.json b/contract/lock.json index dd4a752..d287768 100644 --- a/contract/lock.json +++ b/contract/lock.json @@ -1,5 +1,5 @@ { - "ref": "3e6f6da9cd0b71f9c279394be15c540dca043ef8", - "commit": "3e6f6da9cd0b71f9c279394be15c540dca043ef8", - "sha256": "8634c1cd4775a33c128a70f4b9a829a743165747aef8671f7ced6dee5d6957d3" + "ref": "e0c2332d688f69e5a7efe157f8263eac02ac28d6", + "commit": "e0c2332d688f69e5a7efe157f8263eac02ac28d6", + "sha256": "08565486a9707bf7f11a7e5baeae16fbae38598d89975c5ad6c8178cd066a6c5" } diff --git a/contract/schedule.json b/contract/schedule.json index a0fdd90..60be838 100644 --- a/contract/schedule.json +++ b/contract/schedule.json @@ -50,6 +50,7 @@ "fired_count": 3, "failure_streak": 0, "watch": null, + "runs_on": null, "last_error": null, "last_run": { "id": "run1", diff --git a/contract/schedule_on_device.json b/contract/schedule_on_device.json new file mode 100644 index 0000000..a2e197f --- /dev/null +++ b/contract/schedule_on_device.json @@ -0,0 +1,98 @@ +{ + "schedule": { + "id": "sched3", + "title": "Nightly tests", + "instruction": "Run the tests.", + "request": "every night at 02:00", + "rule": { + "every": { + "minutes": 1440 + } + }, + "description": "Every 1 day", + "timezone": "UTC", + "enabled": true, + "next_run": "2026-01-03T02:00:00+00:00", + "next_runs": [], + "target": "chat", + "mode": "fresh", + "notify": "matters", + "catch_up": "one", + "grace_minutes": null, + "model": null, + "effort": null, + "agents": null, + "tools": [ + "files", + "recall", + "search", + "fetch", + "memory", + "skills", + "plan" + ], + "origin": "user", + "chat_id": "chat2", + "fired_count": 3, + "failure_streak": 0, + "watch": { + "kind": "command", + "command": "git log -1 --format=%H", + "timeout_s": 30, + "target": "git log -1 --format=%H", + "changed_at": "2026-01-02T03:04:05+00:00" + }, + "runs_on": { + "device": "tok1", + "device_name": "bag-end", + "cwd": "/home/frodo/waybread", + "mode": "edit", + "approval_wait_minutes": 30 + }, + "last_error": null, + "last_run": { + "id": "run5", + "schedule_id": "sched3", + "status": "waiting", + "timing": "on_time", + "missed": 0, + "due_at": "2026-01-02T03:04:05+00:00", + "started_at": null, + "finished_at": null, + "waiting_for": "device", + "retry_at": "2026-01-02T03:09:05+00:00", + "progress": { + "phase": "retrying", + "since": 1767323045000, + "reason": "Waiting for bag-end to be linked.", + "in": 0, + "attempt": 1 + }, + "attempts": 1, + "model": { + "id": null, + "name": null, + "reason": null, + "switched_from": null + }, + "tokens": { + "prompt": 0, + "completion": 0 + }, + "cost": null, + "chat_id": null, + "message_id": null, + "report_path": null, + "preview": "", + "error": { + "class": "device_away", + "text": "Waiting for bag-end to be linked." + }, + "notified": false, + "notification": null, + "watch": null + }, + "running": false, + "created_at": "2026-01-02T03:04:05+00:00" + } +} diff --git a/contract/schedule_watching.json b/contract/schedule_watching.json index b518c21..a72ba44 100644 --- a/contract/schedule_watching.json +++ b/contract/schedule_watching.json @@ -37,9 +37,11 @@ "failure_streak": 0, "watch": { "kind": "url", + "url": "https://shop.example/mallorn", "target": "https://shop.example/mallorn", "changed_at": "2026-01-02T03:04:05+00:00" }, + "runs_on": null, "last_error": null, "last_run": { "id": "run4", diff --git a/contract/schedules.json b/contract/schedules.json index 7e8781a..b053da7 100644 --- a/contract/schedules.json +++ b/contract/schedules.json @@ -51,6 +51,7 @@ "fired_count": 3, "failure_streak": 0, "watch": null, + "runs_on": null, "last_error": null, "last_run": { "id": "run1", diff --git a/scripts/strings.py b/scripts/strings.py index eba89e4..87fc3d1 100755 --- a/scripts/strings.py +++ b/scripts/strings.py @@ -377,7 +377,7 @@ STRINGS: dict[str, str] = { "update_available": "%1$s is available. Tap to open its release page.", "update_install": "Install %1$s", "update_auto": "Look for new versions", - "update_auto_line": "At most once a day, when the app starts, it reads the list of LLeMbas for Android releases from GitHub and tells you in a notification when there is a newer one. Nothing about you or your instance is sent. On by default in a beta, off otherwise.", + "update_auto_line": "At most once a day, when the app starts, it asks your instance which release goes with it (an older instance: the list of releases on GitHub) and tells you in a notification when there is a newer one. Nothing about you is sent anywhere else. On by default in a beta, off otherwise.", "update_betas": "Include betas", "update_betas_line": "Offer test versions as well as releases. On by default when this app is itself a beta.", "channel_updates": "App updates", diff --git a/scripts/strings_own.json b/scripts/strings_own.json index ead7926..d5f3ea2 100644 --- a/scripts/strings_own.json +++ b/scripts/strings_own.json @@ -196,7 +196,7 @@ "tune": "Možnosti", "update_allow_installs": "Povolte aplikaci LLeMbas instalovat aktualizace a pak to zkontrolujte znovu.", "update_auto": "Hledat nové verze", - "update_auto_line": "Nejvýš jednou denně, při spuštění, si aplikace přečte z GitHubu seznam vydání LLeMbas pro Android a upozorněním vám dá vědět, když je k dispozici novější. Nic o vás ani o vaší instanci se neposílá. Ve verzi beta zapnuto, jinak vypnuto.", + "update_auto_line": "Nejvýš jednou denně, při spuštění, se aplikace zeptá vaší instance, které vydání k ní patří (u starší instance si přečte seznam vydání na GitHubu), a upozorněním vám dá vědět, když je k dispozici novější. Nic o vás se nikam jinam neposílá. Ve verzi beta zapnuto, jinak vypnuto.", "update_available": "Je k dispozici %1$s. Klepnutím otevřete stránku vydání.", "update_bad_file": "Stažený soubor neodpovídal verzi a byl zahozen.", "update_betas": "Včetně beta verzí", @@ -420,7 +420,7 @@ "tune": "Optionen", "update_allow_installs": "Erlauben Sie LLeMbas, Updates zu installieren, und prüfen Sie dann erneut.", "update_auto": "Nach neuen Versionen suchen", - "update_auto_line": "Höchstens einmal am Tag, beim Start, liest die App die Liste der Releases von LLeMbas für Android auf GitHub und meldet per Benachrichtigung, wenn es eine neuere gibt. Nichts über Sie oder Ihre Instanz wird gesendet. In einer Beta standardmäßig an, sonst aus.", + "update_auto_line": "Höchstens einmal am Tag, beim Start, fragt die App Ihre Instanz, welches Release zu ihr passt (bei einer älteren Instanz: die Liste der Releases auf GitHub), und meldet per Benachrichtigung, wenn es ein neueres gibt. Nichts über Sie wird anderswohin gesendet. In einer Beta standardmäßig an, sonst aus.", "update_available": "%1$s ist verfügbar. Tippen Sie, um die Release-Seite zu öffnen.", "update_bad_file": "Der Download stimmte nicht mit der Version überein und wurde verworfen.", "update_betas": "Betas einbeziehen", @@ -643,7 +643,7 @@ "tune": "Opciones", "update_allow_installs": "Permita que LLeMbas instale actualizaciones y vuelva a comprobarlo.", "update_auto": "Buscar nuevas versiones", - "update_auto_line": "Como mucho una vez al día, al iniciarse, la aplicación lee en GitHub la lista de versiones de LLeMbas para Android y le avisa con una notificación cuando hay una más reciente. No se envía nada sobre usted ni sobre su instancia. Activado por defecto en una beta; si no, desactivado.", + "update_auto_line": "Como mucho una vez al día, al iniciarse, la aplicación pregunta a su instancia qué versión le corresponde (con una instancia más antigua, lee la lista de versiones en GitHub) y le avisa con una notificación cuando hay una más reciente. No se envía nada sobre usted a ningún otro sitio. Activado por defecto en una beta; si no, desactivado.", "update_available": "%1$s está disponible. Toque para abrir su página de publicación.", "update_bad_file": "La descarga no coincidía con la versión y se descartó.", "update_betas": "Incluir betas", @@ -867,7 +867,7 @@ "tune": "Options", "update_allow_installs": "Autorisez LLeMbas à installer des mises à jour, puis vérifiez à nouveau.", "update_auto": "Rechercher de nouvelles versions", - "update_auto_line": "Au plus une fois par jour, au démarrage, l’application lit sur GitHub la liste des versions de LLeMbas pour Android et vous prévient par une notification lorsqu’il en existe une plus récente. Rien sur vous ni sur votre instance n’est envoyé. Activé par défaut dans une bêta, désactivé sinon.", + "update_auto_line": "Au plus une fois par jour, au démarrage, l’application demande à votre instance quelle version lui correspond (avec une instance plus ancienne, elle lit la liste des versions sur GitHub) et vous prévient par une notification lorsqu’il en existe une plus récente. Rien sur vous n’est envoyé ailleurs. Activé par défaut dans une bêta, désactivé sinon.", "update_available": "%1$s est disponible. Touchez pour ouvrir sa page de publication.", "update_bad_file": "Le téléchargement ne correspondait pas à la version et a été rejeté.", "update_betas": "Inclure les bêtas", @@ -1091,7 +1091,7 @@ "tune": "Beállítások", "update_allow_installs": "Engedélyezze, hogy az LLeMbas frissítéseket telepítsen, majd ellenőrizze újra.", "update_auto": "Új verziók keresése", - "update_auto_line": "Naponta legfeljebb egyszer, induláskor az alkalmazás beolvassa a GitHubról a LLeMbas Androidra kiadásainak listáját, és értesítésben jelzi, ha van újabb. Önről és a példányáról semmit sem küld. Béta verzióban alapból bekapcsolva, egyébként kikapcsolva.", + "update_auto_line": "Naponta legfeljebb egyszer, induláskor az alkalmazás megkérdezi a példányát, melyik kiadás illik hozzá (régebbi példánynál a GitHubon lévő kiadások listáját olvassa be), és értesítésben jelzi, ha van újabb. Önről semmi nem megy máshová. Béta verzióban alapból bekapcsolva, egyébként kikapcsolva.", "update_available": "Elérhető a(z) %1$s. Koppintson a kiadás oldalának megnyitásához.", "update_bad_file": "A letöltés nem egyezett a verzióval, és el lett dobva.", "update_betas": "Béták is", @@ -1314,7 +1314,7 @@ "tune": "Opzioni", "update_allow_installs": "Consenti a LLeMbas di installare gli aggiornamenti, poi controlla di nuovo.", "update_auto": "Cerca nuove versioni", - "update_auto_line": "Al massimo una volta al giorno, all’avvio, l’app legge da GitHub l’elenco delle release di LLeMbas per Android e la avvisa con una notifica quando ce n’è una più recente. Non viene inviato nulla su di lei o sulla sua istanza. Attivo per impostazione predefinita in una beta, altrimenti disattivato.", + "update_auto_line": "Al massimo una volta al giorno, all’avvio, l’app chiede alla sua istanza quale release le corrisponde (con un’istanza più vecchia, legge l’elenco delle release su GitHub) e la avvisa con una notifica quando ce n’è una più recente. Nulla su di lei viene inviato altrove. Attivo per impostazione predefinita in una beta, altrimenti disattivato.", "update_available": "%1$s è disponibile. Tocca per aprire la pagina della release.", "update_bad_file": "Il download non corrispondeva alla versione ed è stato scartato.", "update_betas": "Includi le beta", @@ -1537,7 +1537,7 @@ "tune": "Opcje", "update_allow_installs": "Zezwól LLeMbas na instalowanie aktualizacji, a potem sprawdź ponownie.", "update_auto": "Szukaj nowych wersji", - "update_auto_line": "Najwyżej raz dziennie, przy uruchomieniu, aplikacja odczytuje z GitHuba listę wydań LLeMbas na Androida i daje znać powiadomieniem, gdy jest nowsza. Nic o tobie ani o twojej instancji nie jest wysyłane. W wersji beta domyślnie włączone, w przeciwnym razie wyłączone.", + "update_auto_line": "Najwyżej raz dziennie, przy uruchomieniu, aplikacja pyta twoją instancję, które wydanie do niej pasuje (przy starszej instancji odczytuje listę wydań z GitHuba), i daje znać powiadomieniem, gdy jest nowsze. Nic o tobie nie jest wysyłane nigdzie indziej. W wersji beta domyślnie włączone, w przeciwnym razie wyłączone.", "update_available": "Dostępna jest wersja %1$s. Dotknij, aby otworzyć jej stronę wydania.", "update_bad_file": "Pobrany plik nie zgadzał się z wersją i został odrzucony.", "update_betas": "Uwzględniaj bety", @@ -1760,7 +1760,7 @@ "tune": "Možnosti", "update_allow_installs": "Povoľte aplikácii LLeMbas instalovať aktualizácie a potom to skontrolujte znova.", "update_auto": "Hľadať nové verzie", - "update_auto_line": "Najviac raz denne, pri spustení, si aplikácia prečíta z GitHubu zoznam vydaní LLeMbas pre Android a upozornením vám dá vedieť, keď je dostupná novšia. Nič o vás ani o vašej inštancii sa neposiela. V beta verzii zapnuté, inak vypnuté.", + "update_auto_line": "Najviac raz denne, pri spustení, sa aplikácia opýta vašej inštancie, ktoré vydanie k nej patrí (pri staršej inštancii si prečíta zoznam vydaní na GitHube), a upozornením vám dá vedieť, keď je dostupné novšie. Nič o vás sa nikam inam neposiela. V beta verzii zapnuté, inak vypnuté.", "update_available": "Je dostupná %1$s. Ťuknutím otvoríte stránku vydania.", "update_bad_file": "Stiahnutý súbor nezodpovedal verzii a bol zahodený.", "update_betas": "Vrátane beta verzií",