diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e6417a..a3b21eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ is in alpha and releases come off `main`. - **Read aloud on a reply** in a chat, beside Copy, when your instance has text-to-speech: the same voice the assistant answers in. Tap again (or another reply's) to stop; leaving the chat stops it too. +- **A scheduled task that watches a web page** says so on its page (*Only when this page + changes*, and the address), and a run that found the page unchanged is shown as *Unchanged*. +- **A message waiting behind a reply says how many are ahead of it** and for how long it has + waited, where the instance tells. ### Changed 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 6d2c458..92678f6 100644 --- a/app/src/main/java/eu/llembas/android/api/Models.kt +++ b/app/src/main/java/eu/llembas/android/api/Models.kt @@ -412,6 +412,8 @@ data class Message( val steps: List = emptyList(), val plan: JsonObject? = null, val metrics: Metrics? = null, + /** A prompt queued behind a running reply: `{phase: queued, since, ahead}`; null otherwise. */ + val progress: Progress? = null, ) { val isUser: Boolean get() = role == "user" } diff --git a/app/src/main/java/eu/llembas/android/api/Schedules.kt b/app/src/main/java/eu/llembas/android/api/Schedules.kt index a35b289..37198d4 100644 --- a/app/src/main/java/eu/llembas/android/api/Schedules.kt +++ b/app/src/main/java/eu/llembas/android/api/Schedules.kt @@ -63,6 +63,10 @@ data class ScheduleRun( val preview: String = "", val error: RunError? = null, val notified: Boolean = false, + /** The notification the server made for this run, when it made one (see [RunNotification]). */ + val notification: RunNotification? = null, + /** A watching schedule's look at its address on this run (`unchanged` when nothing moved). */ + val watch: RunWatch? = null, ) /** @@ -96,6 +100,8 @@ data class Schedule( @SerialName("chat_id") val chatId: String? = null, @SerialName("fired_count") val firedCount: Int = 0, @SerialName("failure_streak") val failureStreak: Int = 0, + /** Monitor mode: what the schedule watches; the model runs only when it changed. */ + val watch: ScheduleWatch? = null, @SerialName("last_error") val lastError: String? = null, @SerialName("last_run") val lastRun: ScheduleRun? = null, val running: Boolean = false, @@ -171,3 +177,31 @@ data class SchedulingModel( /** `GET`/`PUT /schedules/models`: the models, the instance's order, and the person's narrowing. */ @Serializable data class SchedulingModels(val models: List = emptyList(), val instance: List = emptyList(), val mine: List = emptyList()) + +/** What a watching schedule looks at before each run: [kind] `url` and the address. */ +@Serializable +data class ScheduleWatch(val kind: String = "", val target: String = "", @SerialName("changed_at") val changedAt: String? = null) + +/** One run's look: whether the address [changed] since the last one, or why the look failed. */ +@Serializable +data class RunWatch(val kind: String = "", val changed: Boolean = false, val first: Boolean = false, val bytes: Long = 0, val error: String? = null) + +/** The lock-screen half of a [RunNotification]: the task's name and Finished / Failed only. */ +@Serializable +data class PublicNotice(val title: String = "", val body: String = "") + +/** + * A scheduled run's notification as the server wrote it, in the owner's language: [title] (the + * task's name) and [body] (the result's first lines) for an unlocked phone, [public] for the + * lock screen, and [actions] (`open`, `run_again`, `pause`) with their [labels]. [ask] names the + * action the body asks about (`pause` after failures). + */ +@Serializable +data class RunNotification( + val title: String = "", + val body: String = "", + val public: PublicNotice = PublicNotice(), + val actions: List = emptyList(), + val labels: Map = emptyMap(), + val ask: String = "", +) diff --git a/app/src/main/java/eu/llembas/android/ui/chat/Transcript.kt b/app/src/main/java/eu/llembas/android/ui/chat/Transcript.kt index ed9eafc..af61060 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/Transcript.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/Transcript.kt @@ -88,6 +88,7 @@ import eu.llembas.android.api.ToolCall import eu.llembas.android.lembas import eu.llembas.android.ui.MarkdownText import eu.llembas.android.ui.Segment +import eu.llembas.android.ui.progressLineOf import eu.llembas.android.ui.splitFences import eu.llembas.android.ui.theme.LocalPalette import kotlinx.coroutines.Dispatchers @@ -154,8 +155,9 @@ fun UserMessage(message: Message, canEdit: Boolean, onEdit: () -> Unit, modifier } } if (message.queued) { + // The server's queued progress ("Queued, 2 ahead · 12s") where it sends one. Text( - stringResource(R.string.queued), + progressLineOf(message.progress) ?: stringResource(R.string.queued), style = MaterialTheme.typography.labelSmall, color = palette.inkFaint, modifier = Modifier.padding(top = 4.dp, end = 4.dp), diff --git a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduleLogic.kt b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduleLogic.kt index 20e097e..40cd793 100644 --- a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduleLogic.kt +++ b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduleLogic.kt @@ -11,7 +11,7 @@ enum class Tone { Good, Quiet, Bad, Waiting, Neutral } object ScheduleLogic { fun tone(status: String): Tone = when (status) { "ok" -> Tone.Good - "silent" -> Tone.Quiet + "silent", "unchanged" -> Tone.Quiet "failed", "missed" -> Tone.Bad "waiting", "running" -> Tone.Waiting else -> Tone.Neutral diff --git a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt index df8ec03..f99b40c 100644 --- a/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt +++ b/app/src/main/java/eu/llembas/android/ui/scheduled/ScheduledScreens.kt @@ -301,6 +301,7 @@ fun StatusChip(status: String, missed: Int = 0) { val words = when (status) { "ok" -> stringResource(R.string.run_ok) "silent" -> stringResource(R.string.run_silent) + "unchanged" -> stringResource(R.string.run_unchanged) "failed" -> stringResource(R.string.run_failed) "missed" -> stringResource(R.string.run_missed, maxOf(missed, 1).toString()) "skipped" -> stringResource(R.string.run_skipped) @@ -535,6 +536,15 @@ private fun ScheduleBody( if (facts.isNotEmpty()) { Text(facts.joinToString(" · "), style = MaterialTheme.typography.bodySmall, color = palette.inkFaint) } + schedule.watch?.target?.takeIf { it.isNotBlank() }?.let { url -> + Text( + stringResource(R.string.schedule_watching) + ": " + url, + style = MaterialTheme.typography.bodySmall, + color = palette.inkFaint, + maxLines = 2, + overflow = TextOverflow.Ellipsis, + ) + } } } } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index c309198..e6f4273 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -196,6 +196,8 @@ Nedá vědět nikdy Hotovo Nic nového + Beze změny + Jen když se tato stránka změní Selhalo Zmeškáno ×%1$s Vynecháno diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 706ddd1..cc52ee4 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -196,6 +196,8 @@ Meldet sich nie Fertig Nichts Neues + Unverändert + Nur wenn sich diese Seite ändert Fehlgeschlagen Verpasst ×%1$s Übersprungen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 899587f..1f1f21e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -196,6 +196,8 @@ No avisa nunca Hecho Nada nuevo + Sin cambios + Solo cuando esta página cambie Fallidos Perdida ×%1$s Omitida diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 92f86e3..ad3cfd9 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -196,6 +196,8 @@ Ne prévient jamais Terminé Rien de neuf + Inchangé + Seulement quand cette page change Échecs Manquée ×%1$s Sautée diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 4dd5dd5..07b7444 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -196,6 +196,8 @@ Soha nem szól Kész Semmi új + Változatlan + Csak ha ez az oldal megváltozik Sikertelen Kimaradt ×%1$s Kihagyva diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 6481afa..3f7c9ab 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -196,6 +196,8 @@ Non avvisa mai Fatto Niente di nuovo + Invariato + Solo quando questa pagina cambia Non riusciti Saltata ×%1$s Ignorata diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 36e8ab8..936a104 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -196,6 +196,8 @@ Nigdy nie powiadamia Gotowe Nic nowego + Bez zmian + Tylko gdy ta strona się zmieni Nieudane Pominięto ×%1$s Pominięto diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index cb55598..759d1ff 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -196,6 +196,8 @@ Nedá vedieť nikdy Hotovo Nič nové + Bez zmeny + Len keď sa táto stránka zmení Zlyhalo Zmeškané ×%1$s Vynechané diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ffe4031..62a7f94 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -197,6 +197,8 @@ Never tells you Done Nothing new + Unchanged + Only when this page changes Failed Missed ×%1$s Skipped diff --git a/app/src/test/java/eu/llembas/android/ContractTest.kt b/app/src/test/java/eu/llembas/android/ContractTest.kt index a6e9f3e..4a20df1 100644 --- a/app/src/test/java/eu/llembas/android/ContractTest.kt +++ b/app/src/test/java/eu/llembas/android/ContractTest.kt @@ -130,6 +130,13 @@ class ContractTest { val user = read("message_user", Message.serializer()) assertTrue(user.isUser) assertEquals("How is lembas made?", user.text) + assertNull(user.progress) + + // A prompt waiting behind a running reply says so, and how many are ahead of it. + val queued = read("message_queued", Message.serializer()) + assertTrue(queued.queued) + assertEquals("queued", queued.progress!!.phase) + assertEquals(2, queued.progress!!.ahead) val reply = read("message_assistant", Message.serializer()) assertEquals(listOf("thinking", "text", "tools", "steer", "text"), reply.steps.map { it.kind }) diff --git a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt index 4179a9b..e4c8853 100644 --- a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt +++ b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt @@ -13,7 +13,9 @@ import eu.llembas.android.api.ScheduleRuns import eu.llembas.android.api.SchedulesFrame import eu.llembas.android.api.SchedulingModels import eu.llembas.android.push.ScheduledNotice +import eu.llembas.android.ui.scheduled.ScheduleLogic import eu.llembas.android.ui.scheduled.SchedulingLogic +import eu.llembas.android.ui.scheduled.Tone import kotlinx.serialization.KSerializer import kotlinx.serialization.json.int import kotlinx.serialization.json.jsonArray @@ -84,10 +86,26 @@ class ScheduleContractTest { assertWaybread(read("schedules", ScheduleList.serializer()).schedules.single()) assertWaybread(read("schedule", ScheduleEnvelope.serializer()).schedule) val frame = read("event_schedules", SchedulesFrame.serializer()) - assertEquals("6852d52c0c9575b0", frame.version) + assertEquals("d2f307bf1c7b8d6b", frame.version) assertWaybread(frame.schedules.single()) } + @Test + fun aWatchingScheduleAndItsUnchangedRun() { + // Monitor mode (`schedule_watching.json`): the address it looks at, and a run that found + // nothing changed -- no model, no notification. + val watching = read("schedule_watching", ScheduleEnvelope.serializer()).schedule + assertEquals("url", watching.watch!!.kind) + assertEquals("https://shop.example/mallorn", watching.watch!!.target) + val run = watching.lastRun!! + assertEquals("unchanged", run.status) + assertFalse(run.watch!!.changed) + assertNull(run.notification) + assertEquals(Tone.Quiet, ScheduleLogic.tone(run.status)) + // A schedule that watches nothing says null. + assertNull(read("schedule", ScheduleEnvelope.serializer()).schedule.watch) + } + @Test fun theRunsAWaitingOneAndOneInFull() { val page = read("schedule_runs", ScheduleRuns.serializer()) diff --git a/contract/event_schedules.json b/contract/event_schedules.json index aa48f92..19b480d 100644 --- a/contract/event_schedules.json +++ b/contract/event_schedules.json @@ -1,5 +1,5 @@ { - "version": "6852d52c0c9575b0", + "version": "d2f307bf1c7b8d6b", "schedules": [ { "id": "sched1", @@ -51,6 +51,7 @@ "chat_id": "chat1", "fired_count": 3, "failure_streak": 0, + "watch": null, "last_error": null, "last_run": { "id": "run1", @@ -81,7 +82,25 @@ "report_path": null, "preview": "All the waybread is wrapped.", "error": null, - "notified": true + "notified": true, + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "watch": null }, "running": false, "created_at": "2026-01-02T03:04:05+00:00" diff --git a/contract/folder.json b/contract/folder.json new file mode 100644 index 0000000..996a8b2 --- /dev/null +++ b/contract/folder.json @@ -0,0 +1,10 @@ +{ + "folder": { + "id": "fold1", + "name": "Waybread", + "parent_id": null, + "kind": "", + "position": 0, + "collapsed": false + } +} diff --git a/contract/folders.json b/contract/folders.json new file mode 100644 index 0000000..1200d9d --- /dev/null +++ b/contract/folders.json @@ -0,0 +1,20 @@ +{ + "folders": [ + { + "id": "fold1", + "name": "Waybread", + "parent_id": null, + "kind": "", + "position": 0, + "collapsed": false + }, + { + "id": "fold2", + "name": "Recipes", + "parent_id": "fold1", + "kind": "chat", + "position": 1, + "collapsed": true + } + ] +} diff --git a/contract/lock.json b/contract/lock.json index e44bfa7..dd4a752 100644 --- a/contract/lock.json +++ b/contract/lock.json @@ -1,5 +1,5 @@ { - "ref": "v2.0.0-beta.8", - "commit": "d06ca353b801916302f0ce0cc9ae3e5244ff184f", - "sha256": "2a5bf83cf3e8b1b883cc4e1eae10b91466be868842b3728b276e4db5941001c2" + "ref": "3e6f6da9cd0b71f9c279394be15c540dca043ef8", + "commit": "3e6f6da9cd0b71f9c279394be15c540dca043ef8", + "sha256": "8634c1cd4775a33c128a70f4b9a829a743165747aef8671f7ced6dee5d6957d3" } diff --git a/contract/me.json b/contract/me.json index 0e2d803..aaa535b 100644 --- a/contract/me.json +++ b/contract/me.json @@ -26,5 +26,32 @@ "search": true, "fetch": true, "images": false - } + }, + "scopes": [ + "app", + "models" + ], + "language_setting": "sk", + "languages": [ + { + "id": "en", + "name": "English" + }, + { + "id": "sk", + "name": "Slovenčina" + } + ], + "themes": [ + { + "id": "moria", + "label": "Moria", + "scheme": "dark" + }, + { + "id": "shire", + "label": "Shire", + "scheme": "light" + } + ] } diff --git a/contract/memories.json b/contract/memories.json new file mode 100644 index 0000000..c4c08b2 --- /dev/null +++ b/contract/memories.json @@ -0,0 +1,21 @@ +{ + "memories": [ + { + "id": "mem1", + "content": "Prefers lembas warm.", + "author": "user", + "data_group": { + "id": "default", + "name": "Default" + }, + "created_at": "2026-01-02T03:04:05+00:00", + "updated_at": "2026-01-02T03:04:05+00:00" + } + ], + "groups": [ + { + "id": "default", + "name": "Default" + } + ] +} diff --git a/contract/memory.json b/contract/memory.json new file mode 100644 index 0000000..9206c0a --- /dev/null +++ b/contract/memory.json @@ -0,0 +1,13 @@ +{ + "memory": { + "id": "mem1", + "content": "Prefers lembas warm.", + "author": "user", + "data_group": { + "id": "default", + "name": "Default" + }, + "created_at": "2026-01-02T03:04:05+00:00", + "updated_at": "2026-01-02T03:04:05+00:00" + } +} diff --git a/contract/message_queued.json b/contract/message_queued.json new file mode 100644 index 0000000..bcdc255 --- /dev/null +++ b/contract/message_queued.json @@ -0,0 +1,19 @@ +{ + "id": "msg3", + "role": "user", + "created_at": "2026-01-02T03:04:05+00:00", + "complete": false, + "stopped": false, + "error": null, + "queued": true, + "machine": false, + "origin": "", + "model": null, + "attachments": [], + "text": "And the leaves?", + "progress": { + "phase": "queued", + "since": 1767323045000, + "ahead": 2 + } +} diff --git a/contract/message_user.json b/contract/message_user.json index c6bc99f..5457dc4 100644 --- a/contract/message_user.json +++ b/contract/message_user.json @@ -10,5 +10,6 @@ "origin": "", "model": null, "attachments": [], - "text": "How is lembas made?" + "text": "How is lembas made?", + "progress": null } diff --git a/contract/push_schedule.json b/contract/push_schedule.json new file mode 100644 index 0000000..085dfab --- /dev/null +++ b/contract/push_schedule.json @@ -0,0 +1,34 @@ +{ + "schedule_id": "sched1", + "run_id": "run1", + "chat_id": "chat1", + "status": "ok", + "visibility": "private", + "actions": [ + "open", + "run_again" + ], + "ask": "", + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "pause_label": "Pause", + "title": "LLeMbas", + "body": "A scheduled task has finished.", + "url": "/scheduled/sched1?run=run1", + "kind": "schedule" +} diff --git a/contract/push_schedule_failed.json b/contract/push_schedule_failed.json new file mode 100644 index 0000000..3f8bbd3 --- /dev/null +++ b/contract/push_schedule_failed.json @@ -0,0 +1,37 @@ +{ + "schedule_id": "sched1", + "run_id": "run3", + "chat_id": "chat1", + "status": "failed", + "visibility": "private", + "actions": [ + "open", + "run_again", + "pause" + ], + "ask": "pause", + "notification": { + "title": "Waybread check", + "body": "Failed 3 times in a row. Pause it?", + "public": { + "title": "Waybread check", + "body": "Failed" + }, + "actions": [ + "open", + "run_again", + "pause" + ], + "labels": { + "open": "Open", + "run_again": "Run again", + "pause": "Pause" + }, + "ask": "pause" + }, + "pause_label": "Pause", + "title": "LLeMbas", + "body": "A scheduled task failed 3 times in a row. Pause it?", + "url": "/scheduled/sched1?run=run3", + "kind": "schedule_failed" +} diff --git a/contract/schedule.json b/contract/schedule.json index e39d705..a0fdd90 100644 --- a/contract/schedule.json +++ b/contract/schedule.json @@ -49,6 +49,7 @@ "chat_id": "chat1", "fired_count": 3, "failure_streak": 0, + "watch": null, "last_error": null, "last_run": { "id": "run1", @@ -79,7 +80,25 @@ "report_path": null, "preview": "All the waybread is wrapped.", "error": null, - "notified": true + "notified": true, + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "watch": null }, "running": false, "created_at": "2026-01-02T03:04:05+00:00" diff --git a/contract/schedule_run.json b/contract/schedule_run.json index 0db8c17..c9051ec 100644 --- a/contract/schedule_run.json +++ b/contract/schedule_run.json @@ -28,7 +28,25 @@ "report_path": null, "preview": "All the waybread is wrapped.", "error": null, - "notified": true + "notified": true, + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "watch": null }, "text": "All the waybread is *wrapped*." } diff --git a/contract/schedule_runs.json b/contract/schedule_runs.json index 221b14f..1c87e0e 100644 --- a/contract/schedule_runs.json +++ b/contract/schedule_runs.json @@ -37,7 +37,9 @@ "class": "no_model", "text": "Waiting for a free model: Qwen: it is answering someone." }, - "notified": false + "notified": false, + "notification": null, + "watch": null }, { "id": "run1", @@ -68,7 +70,25 @@ "report_path": null, "preview": "All the waybread is wrapped.", "error": null, - "notified": true + "notified": true, + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "watch": null } ], "more": false diff --git a/contract/schedule_watching.json b/contract/schedule_watching.json new file mode 100644 index 0000000..b518c21 --- /dev/null +++ b/contract/schedule_watching.json @@ -0,0 +1,87 @@ +{ + "schedule": { + "id": "sched2", + "title": "Mallorn price", + "instruction": "Say the new price.", + "request": "every hour, when the page changes", + "rule": { + "every": { + "minutes": 60 + } + }, + "description": "Every 1 hour", + "timezone": "UTC", + "enabled": true, + "next_run": "2026-01-02T04:04:05+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": null, + "fired_count": 7, + "failure_streak": 0, + "watch": { + "kind": "url", + "target": "https://shop.example/mallorn", + "changed_at": "2026-01-02T03:04:05+00:00" + }, + "last_error": null, + "last_run": { + "id": "run4", + "schedule_id": "sched2", + "status": "unchanged", + "timing": "on_time", + "missed": 0, + "due_at": "2026-01-02T03:04:05+00:00", + "started_at": "2026-01-02T03:04:05+00:00", + "finished_at": "2026-01-02T03:04:05+00:00", + "waiting_for": null, + "retry_at": null, + "progress": null, + "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": null, + "notified": false, + "notification": null, + "watch": { + "kind": "url", + "changed": false, + "first": false, + "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "bytes": 5120, + "error": null + } + }, + "running": false, + "created_at": "2026-01-02T03:04:05+00:00" + } +} diff --git a/contract/schedules.json b/contract/schedules.json index cdddca5..7e8781a 100644 --- a/contract/schedules.json +++ b/contract/schedules.json @@ -50,6 +50,7 @@ "chat_id": "chat1", "fired_count": 3, "failure_streak": 0, + "watch": null, "last_error": null, "last_run": { "id": "run1", @@ -80,7 +81,25 @@ "report_path": null, "preview": "All the waybread is wrapped.", "error": null, - "notified": true + "notified": true, + "notification": { + "title": "Waybread check", + "body": "All the waybread is wrapped.", + "public": { + "title": "Waybread check", + "body": "Finished" + }, + "actions": [ + "open", + "run_again" + ], + "labels": { + "open": "Open", + "run_again": "Run again" + }, + "ask": "" + }, + "watch": null }, "running": false, "created_at": "2026-01-02T03:04:05+00:00" diff --git a/contract/scope.json b/contract/scope.json new file mode 100644 index 0000000..a599e64 --- /dev/null +++ b/contract/scope.json @@ -0,0 +1,26 @@ +{ + "scope": { + "families": [ + { + "gate": "notes", + "label": "Notes", + "on": true + }, + { + "gate": "web", + "label": "Web search", + "on": false + } + ], + "skills": [ + { + "name": "baking", + "description": "Bake waybread.", + "on": true + } + ], + "allow": [ + "bash:ls *" + ] + } +} diff --git a/contract/search.json b/contract/search.json new file mode 100644 index 0000000..9c4e46e --- /dev/null +++ b/contract/search.json @@ -0,0 +1,69 @@ +{ + "q": "lembas", + "in": "all", + "offered": [ + "chats", + "files", + "memories" + ], + "results": [ + { + "kind": "chats", + "more": true, + "hits": [ + { + "kind": "chat", + "title": "Waybread", + "snippet": "…how long does lembas keep & travel?", + "marks": [ + [ + 15, + 21 + ] + ], + "archived": false, + "id": "chat1", + "agent": false + } + ] + }, + { + "kind": "files", + "more": false, + "hits": [ + { + "kind": "file", + "title": "bread.md", + "snippet": "/home/frodo/bread.md — Lembas recipe", + "marks": [ + [ + 23, + 29 + ] + ], + "archived": false, + "path": "/home/frodo/bread.md" + } + ] + }, + { + "kind": "memories", + "more": false, + "hits": [ + { + "kind": "memory", + "id": "mem1", + "title": "", + "snippet": "Prefers lembas warm.", + "marks": [ + [ + 8, + 14 + ] + ], + "archived": false + } + ] + } + ] +} diff --git a/scripts/strings.py b/scripts/strings.py index 289f702..c317a91 100755 --- a/scripts/strings.py +++ b/scripts/strings.py @@ -213,6 +213,8 @@ STRINGS: dict[str, str] = { "notify_never": "Never tells you", "run_ok": "Done", "run_silent": "Nothing new", + "run_unchanged": "Unchanged", + "schedule_watching": "Only when this page changes", "run_failed": "Failed", "run_missed": "Missed ×%1$s", "run_skipped": "Skipped",