{ "schema": 1, "name": "remind", "title": "Reminders", "glyph": "⏰", "blurb": "Set a reminder", "collection": "items", "state": { "items": { "key": "id", "fields": { "id": "string", "text": "string", "when": "time", "ts": "time", "sid": "string", "fired": "bool", "firedAt": "time" } } }, "events": { "remind.add": { "require": ["$event.id", "$event.text", "$event.when"], "fold": [ { "add": { "to": "items", "item": { "id": "$event.id", "text": "$event.text", "when": "$event.when", "ts": "$event.ts", "sid": "$event.sid", "fired": false, "firedAt": 0 } } }, { "sort": { "in": "items", "by": "when", "dir": "asc" } } ] }, "remind.fire": { "fold": [ { "update": { "in": "items", "id": "$event.id", "set": { "fired": true, "firedAt": "$event.ts" } } } ] }, "remind.done": { "fold": [ { "remove": { "from": "items", "id": "$event.id" } } ] } }, "partition": { "flag": "fired", "at": "firedAt", "graceMs": 6000 }, "actions": { "add": { "require": ["$input"], "steps": [ { "parse": { "kind": "reminder", "text": "$input", "onFail": { "hint": "When should I remind you? Try “call mum in 10 minutes”, “standup at 9:00”, or “renew passport | 2026-08-01”." } } }, { "schedule": { "at": "$parsed.when", "event": { "type": "remind.fire", "id": "$newId", "notice": { "title": "⏰ Reminder", "body": "$parsed.text" } } } }, { "emit": { "type": "remind.add", "id": "$newId", "text": "$parsed.text", "when": "$parsed.when", "sid": "$sid" } } ] }, "dismiss": { "steps": [ { "if": { "all": [{ "not": { "truthy": "$item.fired" } }, { "truthy": "$item.sid" }] }, "unschedule": "$item.sid" }, { "emit": { "type": "remind.done", "id": "$item.id" } } ] } }, "ticker": { "seconds": 1, "perItem": [ { "once": true, "if": { "all": [{ "not": { "truthy": "$item.fired" } }, { "not": { "truthy": "$item.sid" } }, { "gte": ["$now", "$item.when"] }] }, "emit": { "type": "remind.fire", "id": "$item.id", "notice": { "title": "⏰ Reminder", "body": "$item.text" } } } ] }, "chat": { "remind.fire": { "text": "You asked me to remind you: “{event.notice.body}”", "groupText": "Reminder: “{event.notice.body}”" }, "remind.add": { "text": "set a reminder: “{event.text}” — {event.when|abstime}", "action": true } }, "views": { "main": { "kind": "list", "composer": { "placeholder": "Call the plumber in 2h", "button": "Add", "action": "add", "hint": "e.g. “… in 30m”, “… at 9:00”, or “… | 2026-08-01 14:00”" }, "search": { "fields": ["text"] }, "sections": [ { "id": "upcoming", "source": "active", "order": { "by": "when", "dir": "asc" } }, { "id": "settling", "source": "grace", "order": { "by": "firedAt", "dir": "asc" } }, { "id": "previous", "source": "archived", "title": "Previous reminders ({count})", "collapsible": true, "collapsed": true, "order": { "by": "firedAt", "dir": "desc" } } ], "empty": [ { "if": { "not": { "empty": "$buckets.archived" } }, "text": "No upcoming reminders." }, { "text": "No reminders yet. Add one above, or type /remind in any chat." } ], "row": { "title": { "text": "{item.text}", "strike": { "truthy": "$item.fired" }, "muted": { "truthy": "$item.fired" } }, "subtitle": [ { "if": { "all": [{ "truthy": "$item.fired" }, { "truthy": "$item.firedAt" }] }, "text": "Reminded · {item.firedAt|reltime}" }, { "if": { "truthy": "$item.fired" }, "text": "Reminded" }, { "text": "{item.when|reltime}", "accent": { "gte": ["$now", "$item.when"] } } ], "note": [ { "if": { "all": [{ "not": { "truthy": "$item.fired" } }, { "gt": [{ "sub": ["$item.when", "$now"] }, 86400000] }] }, "text": "{item.when|abstime}" } ], "trailing": [ { "kind": "button", "glyph": "×", "label": "Cancel reminder", "role": "destructive", "action": "dismiss" } ], "tap": { "detail": true } }, "refreshSeconds": 1 }, "detail": { "title": "{item.text}", "sections": [ { "kind": "definitions", "rows": [ { "term": "When", "value": "{item.when|abstime}" }, { "term": "Status", "value": "Reminded", "if": { "truthy": "$item.fired" } }, { "term": "Status", "value": "Upcoming", "if": { "not": { "truthy": "$item.fired" } } }, { "term": "Added", "value": "{item.ts|abstime}", "if": { "truthy": "$item.ts" } } ] }, { "kind": "buttons", "items": [ { "label": "Dismiss reminder", "action": "dismiss", "role": "destructive", "dismiss": true } ] } ] } } }