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 a8ec7ec..bdf1293 100644 --- a/app/src/main/java/eu/llembas/android/api/ApiClient.kt +++ b/app/src/main/java/eu/llembas/android/api/ApiClient.kt @@ -398,6 +398,9 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli return get(if (asked.isEmpty()) "/reports" else "/reports?" + asked).reports } + /** How many reports are unread: the drawer's badge. */ + suspend fun unreadReports(): Int = get("/reports?unread=1").unreadCount + /** One report with its body. Read as the report itself, or as `{report: …}` around it. */ suspend fun report(id: String): Report { val answer = get("/reports/${segment(id)}") diff --git a/app/src/main/java/eu/llembas/android/api/Reports.kt b/app/src/main/java/eu/llembas/android/api/Reports.kt index f4eb3f9..6c37612 100644 --- a/app/src/main/java/eu/llembas/android/api/Reports.kt +++ b/app/src/main/java/eu/llembas/android/api/Reports.kt @@ -38,6 +38,9 @@ data class Report( @JsonNames("created_at") val created: String? = null, val unread: Boolean = false, val body: String? = null, + /** The body as text: every page in it replaced by its one line, `[page: Title]`. */ + val text: String? = null, + val model: String? = null, val chat: JsonElement? = null, ) { val high: Boolean get() = importance == "high" @@ -47,7 +50,14 @@ data class Report( } @Serializable -data class ReportList(val reports: List = emptyList(), val more: Boolean = false) +data class ReportList(val reports: List = emptyList(), val unread: Int? = null) { + /** How many reports are unread: the server's count, else as many as it listed unread. */ + val unreadCount: Int get() = unread ?: reports.count { it.unread } +} + +/** `GET /events`, frame `reports`: the count of the unread, and the newest report. */ +@Serializable +data class ReportsFrame(val unread: Int = 0, val newest: Report? = null) /** `POST /reports/{id}/reply`: the chat the conversation about the report is in. */ @Serializable 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 e2d47d8..af76a43 100644 --- a/app/src/main/java/eu/llembas/android/api/Schedules.kt +++ b/app/src/main/java/eu/llembas/android/api/Schedules.kt @@ -99,6 +99,8 @@ data class Schedule( val mode: String = "", val notify: String = "", @SerialName("notify_when") val notifyWhen: String = "", + /** What "When…" means while [notifyWhen] is empty, in the account's language. */ + @SerialName("notify_default") val notifyDefault: String = "", @SerialName("catch_up") val catchUp: String = "", @SerialName("grace_minutes") val graceMinutes: Int? = null, val model: String? = null, diff --git a/app/src/main/java/eu/llembas/android/ui/home/Drawer.kt b/app/src/main/java/eu/llembas/android/ui/home/Drawer.kt index d7bdfaf..948b31c 100644 --- a/app/src/main/java/eu/llembas/android/ui/home/Drawer.kt +++ b/app/src/main/java/eu/llembas/android/ui/home/Drawer.kt @@ -139,7 +139,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) { // Folders are a side dish: the chats show without them if they cannot be read. val folders = runCatching { api.folders() }.getOrDefault(_state.value.folders) // So is the count of unread reports: an instance before Reports simply has none. - val unread = runCatching { api.reports(unread = true).size }.getOrDefault(0) + val unread = runCatching { api.unreadReports() }.getOrDefault(0) _state.value = ChatsState(chats = page.chats, more = page.more, folders = folders, unreadReports = unread) } catch (e: Exception) { _state.update { it.copy(loading = false, error = getApplication().explain(e)) } diff --git a/app/src/main/java/eu/llembas/android/ui/reports/ReportsScreen.kt b/app/src/main/java/eu/llembas/android/ui/reports/ReportsScreen.kt index cf93775..09c4a2d 100644 --- a/app/src/main/java/eu/llembas/android/ui/reports/ReportsScreen.kt +++ b/app/src/main/java/eu/llembas/android/ui/reports/ReportsScreen.kt @@ -357,8 +357,11 @@ fun ReportScreen(id: String, onBack: () -> Unit, onReply: (chat: String, title: } /** What Share hands over: the title, then the report as text -- a page in it as its one line, never its source. */ -fun shareText(report: Report): String = - listOf(report.title, pageProjection(report.body.orEmpty(), untitled = "Page")).filter { it.isNotBlank() }.joinToString("\n\n") +fun shareText(report: Report): String { + // The server's own text of the body where it sends one; else the same made here. + val text = report.text?.trim()?.ifBlank { null } ?: pageProjection(report.body.orEmpty(), untitled = "Page") + return listOf(report.title, text).filter { it.isNotBlank() }.joinToString("\n\n") +} /** * A report, read as a page: its title, where it came from and when, then the body -- Markdown a 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 6dd3c43..44fadf5 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 @@ -614,7 +614,12 @@ private fun notifyWords(schedule: Schedule): String? = when (schedule.notify) { "always" -> stringResource(R.string.notify_always) // "When…" with the person's own words (spec 3.8.0); a server before it said "matters". - "when" -> stringResource(R.string.notify_when_words, schedule.notifyWhen.ifBlank { stringResource(R.string.notify_when_default) }) + "when" -> stringResource( + R.string.notify_when_words, + schedule.notifyWhen.ifBlank { + schedule.notifyDefault.ifBlank { stringResource(R.string.notify_when_default) } + }, + ) "matters" -> stringResource(R.string.notify_matters) @@ -797,6 +802,8 @@ data class EditState( val notifyWhen: String = "", /** Whether the instance has Reports (LLeMbas 2.0.0-beta.12): an older one is neither shown nor sent "notify when". */ val reports: Boolean = false, + /** The server's default condition in the account's language, when it said one. */ + val notifyDefault: String = "", ) class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) { @@ -819,7 +826,16 @@ class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) { if (id == null) return viewModelScope.launch { runCatching { getApplication().api().schedule(id) }.onSuccess { s -> - _state.update { it.copy(words = s.request.ifBlank { s.instruction }, notify = notifyChoice(s.notify), notifyWhen = s.notifyWhen) } + _state.update { + it.copy( + words = s.request.ifBlank { + s.instruction + }, + notify = notifyChoice(s.notify), + notifyWhen = s.notifyWhen, + notifyDefault = s.notifyDefault, + ) + } } } } @@ -947,7 +963,7 @@ fun ScheduleEditContent( if (state.unsupported) Text(stringResource(R.string.scheduled_unsupported), color = palette.inkMuted) state.error?.let { Text(it, color = palette.danger, style = MaterialTheme.typography.bodyMedium) } state.compiled?.let { Understood(it) } - if (state.reports) NotifyWhen(state.notify, state.notifyWhen, onNotify, onNotifyWhen) + if (state.reports) NotifyWhen(state.notify, state.notifyWhen, state.notifyDefault, onNotify, onNotifyWhen) Spacer(Modifier.height(24.dp)) } } @@ -959,7 +975,7 @@ fun ScheduleEditContent( * task's history. "When…" opens a field with the default already in it. */ @Composable -private fun NotifyWhen(notify: String, words: String, onNotify: (String) -> Unit, onWords: (String) -> Unit) { +private fun NotifyWhen(notify: String, words: String, default: String, onNotify: (String) -> Unit, onWords: (String) -> Unit) { val palette = LocalPalette.current val choices = listOf( Triple("always", R.string.notify_every_run, R.string.notify_every_run_line), @@ -986,7 +1002,7 @@ private fun NotifyWhen(notify: String, words: String, onNotify: (String) -> Unit } } if (value == "when" && notify == "when") { - val usual = stringResource(R.string.notify_when_default) + val usual = default.ifBlank { stringResource(R.string.notify_when_default) } OutlinedTextField( value = words.ifEmpty { usual }, onValueChange = onWords, diff --git a/app/src/test/java/eu/llembas/android/ReportsContractTest.kt b/app/src/test/java/eu/llembas/android/ReportsContractTest.kt new file mode 100644 index 0000000..3d71351 --- /dev/null +++ b/app/src/test/java/eu/llembas/android/ReportsContractTest.kt @@ -0,0 +1,82 @@ +package eu.llembas.android + +import eu.llembas.android.api.LembasJson +import eu.llembas.android.api.PushPayload +import eu.llembas.android.api.Report +import eu.llembas.android.api.ReportList +import eu.llembas.android.api.ReportReply +import eu.llembas.android.api.ReportsFrame +import eu.llembas.android.api.RunResult +import eu.llembas.android.push.ReportNotice +import eu.llembas.android.push.ScheduledNotice +import eu.llembas.android.ui.Segment +import eu.llembas.android.ui.reports.shareText +import eu.llembas.android.ui.splitFences +import kotlinx.serialization.KSerializer +import kotlinx.serialization.json.jsonObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +/** + * The server's reports contract (`contract/report*.json`, `push_report.json`, + * `event_reports.json`, written by its own serialisers): every file read with the app's models, + * and what the app makes of each. + */ +class ReportsContractTest { + private fun text(name: String): String = requireNotNull(javaClass.classLoader!!.getResource("$name.json")) { "contract/$name.json is missing" }.readText() + + private fun read(name: String, serializer: KSerializer): T = LembasJson.decodeFromString(serializer, text(name)) + + @Test + fun theListAndTheCountOfTheUnread() { + val list = read("reports", ReportList.serializer()) + val report = list.reports.single() + assertEquals("rep1", report.id) + assertEquals("Two cakes are unwrapped", report.title) + assertEquals("Two of the twelve cakes have lost their leaves.", report.summary) + assertTrue(report.high) + assertTrue(report.unread) + assertEquals("Waybread check", report.schedule?.title) + assertEquals("2026-01-02T03:04:05+00:00", report.created) + assertEquals(1, list.unreadCount) + // The same for the events frame, which carries the newest one too. + val frame = read("event_reports", ReportsFrame.serializer()) + assertEquals(1, frame.unread) + assertEquals("rep1", frame.newest?.id) + } + + @Test + fun oneReportIsWrappedAndItsPageIsACard() { + // `GET /reports/{id}` answers `{report: …}`: read as ApiClient.report reads it. + val report = LembasJson.decodeFromJsonElement(Report.serializer(), LembasJson.parseToJsonElement(text("report")).jsonObject.getValue("report")) + assertEquals("chat9", report.chatId) + assertEquals("gpt-oss", report.model) + // The body carries the page's source; the phone draws a card in its place, never the source. + val drawn = splitFences(report.body!!) + assertEquals(Segment.Page("Cakes"), drawn.last()) + assertFalse(drawn.any { it is Segment.Code }) + // Share takes the server's own text, where the page is its one line. + assertEquals("Two cakes are unwrapped\n\n## What\n\nTwo of the twelve cakes have lost their leaves.\n\n[page: Cakes]", shareText(report)) + assertFalse(shareText(report).contains("10 wrapped")) + assertEquals("chat9", read("report_reply", ReportReply.serializer()).chatId) + } + + @Test + fun theReportsPush() { + val payload = read("push_report", PushPayload.serializer()) + val notice = ReportNotice.from(payload)!! + assertEquals("rep1", notice.reportId) + // The words are the notification's; the payload's top is the app's name and "New report". + assertEquals("Two cakes are unwrapped", notice.title) + assertEquals("Two of the twelve cakes have lost their leaves.", notice.summary) + assertTrue(notice.high) + assertEquals("LLeMbas", payload.title) + // It is not a scheduled result, though it names the schedule and the run. + assertNull(ScheduledNotice.from(payload)) + // And the run that filed it says which report. + assertEquals("rep1", read("schedule_run", RunResult.serializer()).run.reportId) + } +} diff --git a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt index f404aa3..ca90947 100644 --- a/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt +++ b/app/src/test/java/eu/llembas/android/ScheduleContractTest.kt @@ -51,7 +51,10 @@ class ScheduleContractTest { assertEquals("2026-01-12T07:30:00+00:00", s.nextRun) assertEquals(5, s.nextRuns.size) assertEquals("fresh", s.mode) - assertEquals("matters", s.notify) + // Spec 3.8.0: when the person's own words hold -- none here, so the server's default. + assertEquals("when", s.notify) + assertEquals("", s.notifyWhen) + assertEquals("something needs my attention", s.notifyDefault) assertEquals("one", s.catchUp) assertNull(s.graceMinutes) assertEquals("qwen", s.model) @@ -80,6 +83,9 @@ class ScheduleContractTest { assertEquals("msg2", run.messageId) assertEquals("All the waybread is wrapped.", run.preview) assertTrue(run.notified) + // The run filed a report, and left its line for the history. + assertEquals("rep1", run.reportId) + assertEquals("Filed a report: two cakes are unwrapped.", run.note) } @Test @@ -87,7 +93,7 @@ class ScheduleContractTest { assertWaybread(read("schedules", ScheduleList.serializer()).schedules.single()) assertWaybread(read("schedule", ScheduleEnvelope.serializer()).schedule) val frame = read("event_schedules", SchedulesFrame.serializer()) - assertEquals("8bee85746004dc19", frame.version) + assertEquals("d55e588277f6c90b", frame.version) assertWaybread(frame.schedules.single()) } @@ -226,9 +232,20 @@ class ScheduleContractTest { @Test fun theServersNotificationWordsAndRunAgain() { - // `push_schedule.json`: the task's name and first lines unlocked, Finished on the lock - // screen, Open and Run again with the owner's labels. - val done = ScheduledNotice.from(read("push_schedule", PushPayload.serializer()))!! + // What a server before 3.8.0 sent for a finished run (it sends a report's push now): + // the task's name and first lines unlocked, Finished on the lock screen, Open and Run + // again with the owner's labels. Such an instance is still talked to. + val done = ScheduledNotice.from( + LembasJson.decodeFromString( + PushPayload.serializer(), + """{"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":""}, + "title":"LLeMbas","body":"A scheduled task has finished.","url":"/scheduled/sched1?run=run1","kind":"schedule"}""", + ), + )!! assertEquals("Waybread check", done.title) assertEquals("All the waybread is wrapped.", done.body) assertEquals("Waybread check", done.publicTitle) @@ -248,9 +265,10 @@ class ScheduleContractTest { assertEquals("Failed", failed.publicBody) assertEquals("run3", failed.runId) - // The run's own copy (the schedules frame) says the same. + // The run's own copy of its notification is the report's now: Open alone. val run = read("schedule_run", RunResult.serializer()).run - assertEquals(listOf("open", "run_again"), run.notification!!.actions) + assertEquals(listOf("open"), run.notification!!.actions) + assertEquals("high", run.notification!!.importance) } @Test diff --git a/contract/event_reports.json b/contract/event_reports.json new file mode 100644 index 0000000..ea46a1a --- /dev/null +++ b/contract/event_reports.json @@ -0,0 +1,15 @@ +{ + "unread": 1, + "newest": { + "id": "rep1", + "title": "Two cakes are unwrapped", + "summary": "Two of the twelve cakes have lost their leaves.", + "importance": "high", + "schedule": { + "id": "sched1", + "title": "Waybread check" + }, + "created": "2026-01-02T03:04:05+00:00", + "unread": true + } +} diff --git a/contract/event_schedules.json b/contract/event_schedules.json index 662d565..917245b 100644 --- a/contract/event_schedules.json +++ b/contract/event_schedules.json @@ -1,5 +1,5 @@ { - "version": "8bee85746004dc19", + "version": "d55e588277f6c90b", "schedules": [ { "id": "sched1", @@ -32,7 +32,10 @@ ], "target": "chat", "mode": "fresh", - "notify": "matters", + "notify": "when", + "notify_when": "", + "notify_default": "something needs my attention", + "save_file": false, "catch_up": "one", "grace_minutes": null, "model": "qwen", @@ -81,25 +84,26 @@ "chat_id": "chat1", "message_id": "msg2", "report_path": null, + "report": "rep1", + "note": "Filed a report: two cakes are unwrapped.", "preview": "All the waybread is wrapped.", "error": null, "notified": true, "notification": { - "title": "Waybread check", - "body": "All the waybread is wrapped.", + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", "public": { - "title": "Waybread check", - "body": "Finished" + "title": "New report", + "body": "" }, "actions": [ - "open", - "run_again" + "open" ], "labels": { - "open": "Open", - "run_again": "Run again" + "open": "Open" }, - "ask": "" + "ask": "", + "importance": "high" }, "watch": null }, diff --git a/contract/lock.json b/contract/lock.json index c1724d4..30f2141 100644 --- a/contract/lock.json +++ b/contract/lock.json @@ -1,5 +1,5 @@ { - "ref": "v2.0.0-beta.11", - "commit": "cd9795363195e30232c70409d1cb21e100f94edc", - "sha256": "da264d17c7c4a11ef5774482df5e1eaab9c608078b8c2a151ab026d3d14a7298" + "ref": "ee74edc9f3bf81f50c5c6b14e448211ee502cfdc", + "commit": "ee74edc9f3bf81f50c5c6b14e448211ee502cfdc", + "sha256": "d19ab4ed34614c065bbd360fc88a59844292a9f791c3bdf97d2b59f6127f8770" } diff --git a/contract/push_report.json b/contract/push_report.json new file mode 100644 index 0000000..3b6bad7 --- /dev/null +++ b/contract/push_report.json @@ -0,0 +1,29 @@ +{ + "report_id": "rep1", + "schedule_id": "sched1", + "run_id": "run1", + "visibility": "private", + "actions": [ + "open" + ], + "notification": { + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", + "public": { + "title": "New report", + "body": "" + }, + "actions": [ + "open" + ], + "labels": { + "open": "Open" + }, + "ask": "", + "importance": "high" + }, + "title": "LLeMbas", + "body": "New report", + "url": "/reports/rep1", + "kind": "report" +} diff --git a/contract/push_schedule.json b/contract/push_schedule.json deleted file mode 100644 index 085dfab..0000000 --- a/contract/push_schedule.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "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/report.json b/contract/report.json new file mode 100644 index 0000000..036e501 --- /dev/null +++ b/contract/report.json @@ -0,0 +1,24 @@ +{ + "report": { + "id": "rep1", + "title": "Two cakes are unwrapped", + "summary": "Two of the twelve cakes have lost their leaves.", + "importance": "high", + "schedule": { + "id": "sched1", + "title": "Waybread check" + }, + "created": "2026-01-02T03:04:05+00:00", + "unread": true, + "body": "## What\n\nTwo of the twelve cakes have lost their leaves.\n\n```html-view Cakes\n

10 wrapped, 2 not

\n```\n", + "text": "## What\n\nTwo of the twelve cakes have lost their leaves.\n\n[page: Cakes]\n", + "pages": [ + { + "title": "Cakes", + "digest": "526b3a6b58f09769d9f81f628942cc7f" + } + ], + "model": "gpt-oss", + "chat": "chat9" + } +} diff --git a/contract/report_reply.json b/contract/report_reply.json new file mode 100644 index 0000000..e0e1650 --- /dev/null +++ b/contract/report_reply.json @@ -0,0 +1,3 @@ +{ + "chat": "chat9" +} diff --git a/contract/reports.json b/contract/reports.json new file mode 100644 index 0000000..6371180 --- /dev/null +++ b/contract/reports.json @@ -0,0 +1,17 @@ +{ + "reports": [ + { + "id": "rep1", + "title": "Two cakes are unwrapped", + "summary": "Two of the twelve cakes have lost their leaves.", + "importance": "high", + "schedule": { + "id": "sched1", + "title": "Waybread check" + }, + "created": "2026-01-02T03:04:05+00:00", + "unread": true + } + ], + "unread": 1 +} diff --git a/contract/schedule.json b/contract/schedule.json index 60be838..af57d56 100644 --- a/contract/schedule.json +++ b/contract/schedule.json @@ -30,7 +30,10 @@ ], "target": "chat", "mode": "fresh", - "notify": "matters", + "notify": "when", + "notify_when": "", + "notify_default": "something needs my attention", + "save_file": false, "catch_up": "one", "grace_minutes": null, "model": "qwen", @@ -79,25 +82,26 @@ "chat_id": "chat1", "message_id": "msg2", "report_path": null, + "report": "rep1", + "note": "Filed a report: two cakes are unwrapped.", "preview": "All the waybread is wrapped.", "error": null, "notified": true, "notification": { - "title": "Waybread check", - "body": "All the waybread is wrapped.", + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", "public": { - "title": "Waybread check", - "body": "Finished" + "title": "New report", + "body": "" }, "actions": [ - "open", - "run_again" + "open" ], "labels": { - "open": "Open", - "run_again": "Run again" + "open": "Open" }, - "ask": "" + "ask": "", + "importance": "high" }, "watch": null }, diff --git a/contract/schedule_on_device.json b/contract/schedule_on_device.json index a2e197f..44633f6 100644 --- a/contract/schedule_on_device.json +++ b/contract/schedule_on_device.json @@ -16,7 +16,10 @@ "next_runs": [], "target": "chat", "mode": "fresh", - "notify": "matters", + "notify": "when", + "notify_when": "", + "notify_default": "something needs my attention", + "save_file": false, "catch_up": "one", "grace_minutes": null, "model": null, @@ -83,6 +86,8 @@ "chat_id": null, "message_id": null, "report_path": null, + "report": null, + "note": "", "preview": "", "error": { "class": "device_away", diff --git a/contract/schedule_run.json b/contract/schedule_run.json index c9051ec..94fb0a0 100644 --- a/contract/schedule_run.json +++ b/contract/schedule_run.json @@ -26,25 +26,26 @@ "chat_id": "chat1", "message_id": "msg2", "report_path": null, + "report": "rep1", + "note": "Filed a report: two cakes are unwrapped.", "preview": "All the waybread is wrapped.", "error": null, "notified": true, "notification": { - "title": "Waybread check", - "body": "All the waybread is wrapped.", + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", "public": { - "title": "Waybread check", - "body": "Finished" + "title": "New report", + "body": "" }, "actions": [ - "open", - "run_again" + "open" ], "labels": { - "open": "Open", - "run_again": "Run again" + "open": "Open" }, - "ask": "" + "ask": "", + "importance": "high" }, "watch": null }, diff --git a/contract/schedule_runs.json b/contract/schedule_runs.json index 1c87e0e..93c290d 100644 --- a/contract/schedule_runs.json +++ b/contract/schedule_runs.json @@ -32,6 +32,8 @@ "chat_id": null, "message_id": null, "report_path": null, + "report": null, + "note": "", "preview": "", "error": { "class": "no_model", @@ -68,25 +70,26 @@ "chat_id": "chat1", "message_id": "msg2", "report_path": null, + "report": "rep1", + "note": "Filed a report: two cakes are unwrapped.", "preview": "All the waybread is wrapped.", "error": null, "notified": true, "notification": { - "title": "Waybread check", - "body": "All the waybread is wrapped.", + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", "public": { - "title": "Waybread check", - "body": "Finished" + "title": "New report", + "body": "" }, "actions": [ - "open", - "run_again" + "open" ], "labels": { - "open": "Open", - "run_again": "Run again" + "open": "Open" }, - "ask": "" + "ask": "", + "importance": "high" }, "watch": null } diff --git a/contract/schedule_watching.json b/contract/schedule_watching.json index a72ba44..943864e 100644 --- a/contract/schedule_watching.json +++ b/contract/schedule_watching.json @@ -16,7 +16,10 @@ "next_runs": [], "target": "chat", "mode": "fresh", - "notify": "matters", + "notify": "when", + "notify_when": "", + "notify_default": "something needs my attention", + "save_file": false, "catch_up": "one", "grace_minutes": null, "model": null, @@ -70,6 +73,8 @@ "chat_id": null, "message_id": null, "report_path": null, + "report": null, + "note": "", "preview": "", "error": null, "notified": false, diff --git a/contract/schedules.json b/contract/schedules.json index b053da7..6fdff2f 100644 --- a/contract/schedules.json +++ b/contract/schedules.json @@ -31,7 +31,10 @@ ], "target": "chat", "mode": "fresh", - "notify": "matters", + "notify": "when", + "notify_when": "", + "notify_default": "something needs my attention", + "save_file": false, "catch_up": "one", "grace_minutes": null, "model": "qwen", @@ -80,25 +83,26 @@ "chat_id": "chat1", "message_id": "msg2", "report_path": null, + "report": "rep1", + "note": "Filed a report: two cakes are unwrapped.", "preview": "All the waybread is wrapped.", "error": null, "notified": true, "notification": { - "title": "Waybread check", - "body": "All the waybread is wrapped.", + "title": "Two cakes are unwrapped", + "body": "Two of the twelve cakes have lost their leaves.", "public": { - "title": "Waybread check", - "body": "Finished" + "title": "New report", + "body": "" }, "actions": [ - "open", - "run_again" + "open" ], "labels": { - "open": "Open", - "run_again": "Run again" + "open": "Open" }, - "ask": "" + "ask": "", + "importance": "high" }, "watch": null },