Files
coucou/relay/README.md
LouisandClaude Opus 5.5 30edad4c5c iPhone: act from notifications, answer questions, Siri, Control Center + new coucou sound (#241)
* New coucou sound for Mochi's greeting

Taken from the reel's audio, aligned so the pop lands when Mochi drops
in (1.3 s) and the chime when he waves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* iPhone: act from notifications, answer questions, Siri, Control Center, quiet hours

- Approval notifications get Allow (opens Coucou, Face ID right away), Review and Deny.
- A notification when an agent finishes or fails, with Reply to send the next
  instruction; a question notification with one button per choice.
- Claude's questions (AskUserQuestion) can be answered from the iPhone: the
  Mac publishes the choices and applies an Answer only if it matches the
  question still waiting and every pick is one of its choices (QuestionRelay).
- Shortcuts above the instruction field, kept on the iPhone.
- Earlier turns of a session, a finished turn shared as a picture, diffs full
  screen (the iPhone can turn sideways there).
- Today's tally on the home screen, counted on the iPhone.
- Lock Screen widgets draw Mochi so his face shows, with a progress ring.
- A Control Center button and Siri / Shortcuts intents (agent status, ask Claude).
- Mochi's own sounds in the notifications, and quiet hours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* Lock Screen widgets: Mochi drawn white with his eyes cut out

The Lock Screen keeps brightness: the black luminance mask made him
vanish in the circular widget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* Approval notification: lay the card out with constraints and a clearer design

The expanded view came up empty: the SwiftUI view was added in
didReceive with a frame of zero size. It is now pinned with constraints
in viewDidLoad, with explicit colors, Mochi in his agent's color and the
command in its own box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* Allow and Deny on the Live Activity

While a command waits for your OK, the Lock Screen activity and the
expanded Dynamic Island show Deny (answers right away) and Allow (opens
Coucou on the command, Face ID before anything is sent). The Mac adds the
command's fingerprint, an opaque hash, to the activity state; the relay
accepts it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* Allow right from the Live Activity and the notification

No detour through the app: iOS has the owner unlock the iPhone (Face ID)
when it is locked, then the OK goes to the Mac, which applies it only to
that exact command. Allow inside the app still asks for Face ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

* Smooth transitions for every change of Mochi's phase

Live Activity, Dynamic Island, widgets and the iPhone app: Mochi's face
pops from one state to the next, status texts morph, the Allow / Deny
buttons and the steps slide in, sessions move to their new place, and the
approval and question cards drop in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-05 16:59:49 +02:00

1.8 KiB

Coucou relay

A tiny Cloudflare Worker that lets the Mac app start and update the iPhone's Live Activity (Mochi in the Dynamic Island while the Mac is locked).

Why it exists: Live Activity pushes must be signed with the APNs key, and that key can't ship inside the Mac app. The Mac posts Mochi's state here; the relay signs and forwards it to Apple.

What it sees: the push token of the iPhone's Live Activity and Mochi's state (agent name, state, "working · 3/7", counts), plus, while a command waits for your OK, its fingerprint (a SHA-256 hash, so the Lock Screen's Allow and Deny answer that exact command). Never a project name, a command, a path or a message. It stores nothing and logs nothing.

Deploy (once)

  1. Apple Developer → Certificates, Identifiers & Profiles → Keys → +. Name it "Coucou relay", tick Apple Push Notifications service (APNs), environment Sandbox & Production, Continue, Register, Download the AuthKey_XXXXXXXXXX.p8 (only downloadable once). Note the Key ID.
  2. A free Cloudflare account, then in this folder:
    npm install
    npx wrangler login
    npx wrangler secret put APNS_KEY_ID      # paste the Key ID
    npx wrangler secret put APNS_KEY < ~/Downloads/AuthKey_XXXXXXXXXX.p8
    npx wrangler deploy
    
    deploy prints the URL, like https://coucou-relay.<you>.workers.dev.
  3. Check it: curl https://coucou-relay.<you>.workers.dev/ answers "Coucou relay".

API

POST /v1/live-activity

{ "token": "<hex>", "env": "development|production", "event": "start|update|end",
  "state": { "pillId": "", "agent": "", "color": "", "state": "", "statusText": "",
             "tone": "", "stepIndex": 0, "stepCount": 0, "others": 0 },
  "urgent": false, "dismissAfter": 0 }

200 when Apple accepted the push, 410 when the token is no longer valid, 400 when the request is malformed.