Overview
This page is the single contract for the iPhone system surfaces: notification buttons, the Live Activity, the status widget, App Intents and Shortcuts, and the Messages tool on macOS runtimes. The iOS app, the cloud API and the runtime all build against it. Design rules:- One action path. Notification buttons call
POST /api/v1/inbox/:id/{approve|dismiss|snooze}through the runtime relay. There is no cloud-side approve endpoint, so there is one authority for an approval. - Runtime-owned status snapshot. The runtime forwards
status.snapshotwhen state changes. It drives the Live Activity, the widget, the badge and the revoke push. The cloud does not derive state from single events, because it has no run or loop state. - Revoke by snapshot diff. When an inbox id leaves
needsYou, the cloud sends a background push that removes the delivered notification. The app also reconciles on every foreground. - Sensitive text is fetched by the extension. The APNs alert carries a generic body when the item is private. The notification service extension fetches the text by event id with a device read token.
- Web never approves from a URL. With a window open, the service worker posts the action to it. With none open, it opens the item.
Forwarded event keys (planned)
The runtime event forwarder (runtime_events.rs, DATA_KEYS) adds these keys. The cloud adds runtimeId at ingest.
Inbox items also carry
contentHash, sessionId and full {to, toName, text}. A new inbox kind, gizzi_permission, covers tool permissions from Gizzi.
Status snapshot (planned)
status.snapshot is a forwarded event type. It is never pushed as an alert. The runtime emits it on change, at most one per 5 seconds. The cloud keeps the latest one per runtime.
needsYouis a list of ids. It is the input to the revoke diff.- The focus bot is chosen in this order: oldest pending approval, then a bot that needs input, then a blocked or failed bot, then the most recently started working bot.
- Limits:
botsholds at most 20 entries,needsYouRowsat most 4, and eachlineat most 80 characters.progressis optional. - Loop source: the snapshot producer polls the Gizzi server’s
GET /v1/automations/loopson loopback. It polls every 5 seconds while a loop runs and every 60 seconds otherwise. A failed poll leavesloopsout of the snapshot, so a Gizzi restart does not end the activity.
Phone run in the snapshot (new in this release)
While a phone or computer run is live, and shortly after it ends, the snapshot also carriesphoneRun:
kindisphoneorcomputer.statususes the same values as the phone task card.summaryandinboxIdare optional.stepLabelfollows the step label rule.trailholds the last 6 steps.phoneRunis absent when no run is live or recently ended.- The runtime builds the snapshot in
cmd/allternit-api/src/status_snapshot.rsand pushes it every 5 seconds on change. Cloud stores it as opaque JSON, so it needs no migration. - The iMessage extension reads it through
GET /api/v1/status/summarywith its existing read token, so no new auth scope exists.
Notification categories (planned)
The category comes frominboxKind, not from the event name. An email draft that arrives as thread.needs_user therefore still gets approval buttons.
Action identifiers are fixed. Titles and wording come from one strings table in the app.
Reply on an approval sends the owner’s message to the bot through
POST /api/v1/agent-sessions/:id/messages and leaves the item pending. If the bot revises the item, the hash changes and the old Approve answers 409 changed.
Inline approve rule
An item getsAPPROVAL_INLINE only when all of these hold:
- The full text and the recipient together fit in 300 characters.
- There is no attachment.
contentHashis present.
APPROVAL_REVIEW. The approve call carries the hash. If it does not match the current item, the runtime answers 409 {"error":"changed"} and nothing is sent.
APNs alert payload (planned)
Existing keys stay. New keys ride inPushMessage.data, so the struct does not change.
- A token without the
nsecapability gets today’s body. A token withoutactionsgets nocategory. interruption-levelistime-sensitiveonly at levelNeedsYouand above.- Every alert carries
sound.
Other pushes (planned)
Revoke
Sent when an inbox id leavesneedsYou. apns-push-type: background, priority 5.
Live Activity
- Header
apns-push-type: liveactivity. Topiccom.allternit.mobile.push-type.liveactivity. - Events:
start,update,end. - Payload:
{"aps":{"timestamp":..., "event":"start|update|end","content-state":{...},"stale-date":...,"alert":{...,"sound":"default"},"attributes-type":"BotActivityAttributes","attributes":{"mode":"summary"},"input-push-token":1}}. - Bot activity content state (
BotActivityAttributes.ContentState):- Always, as the app has them today:
status(String),activityLabel(String, optional in the app),pendingApprovalsCount(Int),activeBotsCount(Int),attentionBotsCount(Int),displayName(String, optional in the app). - Optional additions:
botId(String),step(String),progress(Double, 0 to 1),othersCount(Int),question(String),inboxId(String),runtimeId(String),sessionId(String),contentHash(String),approveInline(Bool). Absent ones are left out. - There are no
Datevalues.
- Always, as the app has them today:
- Loop activity content state (
LoopActivityAttributes.ContentState), unchanged:iterationsCompleted(Int),maxIterations(Int),state(String). Updated and ended byactivityKey=loopId; the app starts loops itself. - Token keys the app uploads:
la_startwithattributesType: "BotActivityAttributes";la_updatewithactivityKey: "summary"for the bot activity andactivityKey: <loopId>for a loop;widget. Full rules and examples: iPhone push. - The activity is bot first. The cloud fills it from
focus. When a bot needs the owner it turns into the question with buttons. - Approve and Deny show only when
approveInlineistrue,privateisfalse, and the full text is 140 characters or fewer. Otherwise the activity shows a generic line and Open. Live Activity pushes travel in plain form, so private text never rides in them. - Throttles: progress updates use priority 5 and are at least 15 seconds apart. Needs-approval uses priority 10 with an alert; end uses priority 10 without one (the run-finished notification already tells). A start happens only on idle to active, at most once per 10 minutes per device, and never while quiet hours hold the level.
- The cloud ends and restarts an activity before it reaches 8 hours.
NSSupportsLiveActivitiesFrequentUpdatesstays off.
Widget
- Header
apns-push-type: widgets. Topiccom.allternit.mobile.push-type.widgets. Requires iOS 26. - Payload
{"aps":{"content-changed":true}}. At most one per 5 minutes per device; a change inside the window is sent when it ends. - Sent when what the widget shows changes: the counts,
needsYouRows,pausedorlastRoutine. A new step or progress is not a widget change. Tokens:kind: "widget", on devices with thewidget_pushcapability. Details: iPhone push. - The widget is one flipping widget. The front shows status and the back shows actions. A flip button turns it over, and the front returns after 10 minutes. The accessory (Lock Screen) family shows the status face only.
Cloud routes (planned)
The read token works on
GET /api/v1/status/summary and GET /api/v1/notifications/content/:eventId only, and only for its own user.
Web Push subscribe adds platform: ios-pwa, android or desktop.
Runtime routes (planned)
Pause all bots
GET /api/v1/bots/pause answers:
paused: boolean.since: Unix seconds when the switch was turned on, ornullwhen not paused.by: the surface that turned it on, ornull. Values in use:web,phone,desktop,ios,shortcut,control,gizzi.
PUT /api/v1/bots/pause takes {"paused": true, "by": "phone"} (by is optional) and answers the same object as GET. Pausing again keeps the first since and by. Resuming sets both to null. A body with no paused answers 422.
While paused:
- A due routine or loop is skipped, not run. It keeps its schedule and runs at its next slot after resume, so there is never a burst of missed runs. A skipped routine gets a run row with status
skippedandoutcome_reasonbots_paused. Startup routines do not run. - Channel messages from people (Telegram, Discord, WhatsApp, Teams, SMS, Slack, bot email) are kept but get no auto-reply. They show as
unansweredin Needs you. A message from the account’s verified owner still runs. - The main bot does not reach out on its own.
- A run already in progress finishes. Pause is not stop.
- The owner’s own messages in the app, Run now, and approvals still work.
status.snapshot) carries paused from this switch. A change wakes the snapshot producer, which sends within 5 seconds.
Messages on the Mac
Built incmd/allternit-api/src/messages_mac.rs. User guide: Messages on your Mac.
access.fullDiskis true when the runtime can open~/Library/Messages/chat.db. It opens the file read-only and immutable and never writes it.access.automationis the result of a harmless AppleScript probe to Messages. It is probed only while the setting is on, so aGETnever raises the macOS prompt for someone who has not opted in. A yes is cached; a no is retried after a minute.- A send hold is a
gateway_approvalsrow with actionsend imessageanddetail {to, toName, text, channel: "imessage", provenance}, made through the same path as held channel posts. Needs you lists it asheld_sendwith sourceimessage,contentHash, andfull {to, toName, text}. - The send runs only when the hold is approved (
respond_approval, any approve path). It re-reads the row, checksstate = approvedandconsumed = 0, setsconsumed = 1in the same transaction, then runsosascriptwith the recipient and text as arguments. A second approve never sends twice. The approve answer carriessend {state: "sent" | "error" | "already_sent"}. - Recipients are one phone number or email address. Group chat ids are refused.
- Every search, hold and send writes a row to
messages_mac_audit.
/internal/connectors/mcp:
messages_search {contact?, query?, sinceDays (max 30), limit (max 50)}. Listed only on a macOS runtime with the setting on. Answers{ok, rows: [{handle, name, fromMe, at, text, provenance}], provenance};atis Unix seconds and eachtextis fenced as outside text. 1:1 chats only.messages_send {to, text}. Listed only on a macOS runtime with the setting on. Returns{held: true, inboxId}. It always creates agateway_approvalshold and bypasses channel transports and autonomy levels.message_draft {to, text}. Listed on every runtime. Emits the card{"type":"message_draft","to","toName","text"}. Nothing is held or sent.
Provenance of Messages search results
Search results go to the model fenced as outside text, withprovenance {trust, sourceKind: "imessage"}. trust is contact when the handle belongs to someone in the owner’s People (a linked identity) and stranger otherwise. The runtime does not read the macOS Contacts database. A message that trips the injection scanner is down-ranked to stranger. When the search ran inside a bot conversation, each result is recorded as content provenance on that thread.
A hold made in a turn that read such text stores the lowest trust seen in detail.provenance. The inbox shows it.
Migration 120 (planned)
File:migrations_pg/120_ios_system_surfaces.sql. The file is additive and idempotent, and is never edited after it ships. Production applies it with deploy-contabo.sh, which applies files missing from public.ops_applied_migrations before the binary swap.
Device capabilities and old clients (planned)
Each device registers a capability list with its token.
A client that sends no
capabilities is treated as having none. It keeps today’s alerts and loses nothing. Old runtimes that do not forward the new keys produce Review or plain alerts, never inline Approve.