diff --git a/docs/SPEC-ios-app.md b/docs/SPEC-ios-app.md index 8f9e3ad..2d54e9d 100644 --- a/docs/SPEC-ios-app.md +++ b/docs/SPEC-ios-app.md @@ -8,6 +8,8 @@ > - Audit hat S-07, S-08 und Tree-Read als out-of-the-box machbar bestätigt → von PENDING auf firm SHOULD. > - **Tree-Navigation komplett aus iOS entfernt.** Gruppe T gestrichen. Begründung: Slash-Command-Dispatch ist in der ExtensionAPI blockiert, Workarounds (Hack oder Re-Implement) sind nicht den Aufwand wert. Tree-Navigation bleibt nativ in pi. > - Spike-0a abgeschlossen, ist nun referenziertes Audit-Dokument. +> - **Q-A** geschlossen: pi-CLI `-p`/`--print` Mode funktioniert mit Haiku 4.5 in ~2s. S-09a hat jetzt konkrete CLI-Flags. +> - **Q-C** geschlossen: APNs-Setup-Details unter iOS-C-02. Sidecar routet pro Device-Token nach Sandbox (Xcode-Debug) vs. Production (TestFlight/Release). --- @@ -222,17 +224,17 @@ Kein eigener JSON-State-Store im Sidecar. der Sidecar einen One-Shot-Call via pi-CLI: ```bash -pi --one-shot --model claude-haiku-4-5 \ - --prompt "Title for this conversation in 2-4 words: " +pi -p --provider anthropic --model claude-haiku-4-5 \ + --no-tools --no-context-files --no-extensions --no-session \ + --thinking off \ + "Give a 2-4 word title for: ''. Reply with title only." ``` -(genaue CLI-Flags TBD; pi's eigene Anthropic-Auth wird verwendet, keine -separaten Credentials nötig) +~2s Latenz, pi's eigene Anthropic-Auth wird verwendet — keine separaten +Credentials nötig. Ergebnis landet als `@description` in tmux. +Manuelles Umbenennen aus der App jederzeit möglich und überschreibt. -Ergebnis landet als `@description` in tmux. Manuelles Umbenennen aus -der App jederzeit möglich und überschreibt. - -*Dependencies:* S-09, pi-CLI one-shot mode +*Dependencies:* S-09 ### S-10 — Pairing & Bearer-Token-Auth **MUST.** CLI `pi-remote pair` generiert ein kurzlebiges (5min) @@ -424,10 +426,44 @@ S-07. #### iOS-C-02 — Push-Notification bei Awaiting-Input **MUST.** Wenn App im Background und Pi wechselt zu `awaiting-input`: -Push-Notification "Pi ist fertig". Tap → App öffnet in der richtigen -Session. +Push-Notification "Pi ist fertig · ". Tap → App öffnet in +der richtigen Session. -*Dependencies:* S-07, APNs +**APNs-Setup:** +- Apple Developer Portal: App-ID mit Push-Capability + + APNs Auth-Key (`.p8`, einmaliger Download). Notiere Team-ID und Key-ID. +- Dieselbe `.p8`-Datei funktioniert für Sandbox und Production. +- Sidecar-Config (neue Sektion in `~/.config/pi-remote/config.toml`): + ```toml + [apns] + team_id = "..." + key_id = "..." + key_path = "/etc/pi-remote/AuthKey_.p8" + bundle_id = "de.vpsj.pi-remote" + ``` +- **Environment-Routing pro Device:** + Xcode-Debug-Builds (lokales Testen via WiFi-Pair) registrieren ihre + Device-Tokens bei der Sandbox; TestFlight- und Release-Builds gehen + gegen Production. Beide gleichzeitig betreibbar, da derselbe Key + funktioniert. Sidecar speichert pro Device-Token ein `environment: + "sandbox" | "production"` Feld und routet beim Push entsprechend zu + `api.sandbox.push.apple.com` bzw. `api.push.apple.com`. +- **Pairing-Erweiterung (S-10):** iOS-App schickt beim Pairing + zusätzlich `{deviceToken, environment, deviceName}`. `environment` + bestimmt sich zur Compile-Time aus der Build-Config. +- **HTTP-Headers**: + - `apns-topic: ` + - `apns-push-type: alert` (required ab iOS 13) + - `apns-priority: 10` + - `apns-collapse-id: session-` — verhindert Notification-Spam, neuere + State-Wechsel überschreiben ältere im Lock-Screen. +- **JWT:** ES256-signed mit `.p8`-Key, 1h gültig, im Sidecar für ~55min + cachen. +- **Auto-Cleanup:** APNs-Response `410 Gone` → Device-Token tot, Sidecar + löscht Mapping. App registriert beim nächsten Launch neu. +- **Library:** `@parse/node-apn` oder `node-apn-http2`. + +*Dependencies:* S-07, S-10 (Pairing trägt Device-Token), APNs Auth-Key #### iOS-C-03 — Haptic Feedback bei State-Wechseln **NICE.** Subtile Vibration bei `thinking → idle` oder @@ -581,9 +617,8 @@ Kein weiterer Spike vor Phase 1 nötig. --- -## 9. Offene Punkte für v4 +## 9. Offene Punkte -- **Q-A** — pi-CLI one-shot mode für S-09a: CLI-Flags müssen verifiziert - werden. Existiert das in der heutigen pi-CLI? -- **Q-C** — APNs-Setup Details (Auth-Key-Provisioning, Token-Lifecycle). +Keine offenen Punkte mehr in v3. Q-A und Q-C wurden in dieser Version +geschlossen (siehe S-09a bzw. iOS-C-02).