Pull requests / #3348

#3348 [GUI] Add a paired iPhone companion for Mac conversations

open · draft · @jorge123255 · 0 comentários · No GitHub

Setup & installServer & APISecurityDocumentation

Descrição

## Problem and result

Strata's Mac conversations currently cannot be opened and continued from a native iPhone app. This adds an optional SwiftUI companion using Strata's emerald, charcoal and white palette. After pairing, the phone shows the Mac's existing history, expandable Thinking, ordered progress and browser/tool activity, and can continue that same conversation, answer approvals or Stop its work. Inference remains on the Mac or its configured provider.

## Related discussion

Scope proposal: #3346. **Runtime dependency: #3347**, which supplies opt-in Mac pairing and the shared-conversation API. This branch contains the native client only, starts from the same upstream base, and does not duplicate that PR's Mac changes. Maintainer agreement is pending; both submissions remain drafts for scope and implementation review.

## Approach

- Pair with a five-minute, one-use QR invitation or manual entry. Pin the exact TLS certificate before sending credentials, reject redirects, and save the connection in the device-only Keychain. Camera access is optional; local-network access is required.
- Reopen and continue Mac conversations with their existing model, workspace and permission mode. New conversations use the Mac's default workspace and ask before actions. Earlier private phone-only conversations retain their text-only continuation path.
- Refresh the selected chat in the foreground; show Thinking, reply paragraphs, progress groups, browser/tool cards and pending approvals in their recorded order. Keep Mac work running when the phone leaves the app. Discard stale responses after switching or disconnecting.
- Include a portable synthetic fixture using the real HTTPS bridge and authentication, plus unit/UI coverage. No personal signing team, provisioning profile, pairing credentials or local deployment reports are included. Build and signing instructions are in `apps/ios/README.md`.

## Validation

Fresh checks at **680bc505ba318ab75367be25efc579132f1d538a**, based on upstream **e88ee39d**, using the Mac bridge at **818ecf4c**. Subsequent changes on this branch are documentation and a public synthetic UI preview only; application code, project settings, fixture and tests are unchanged. Environment: **macOS 26.5 arm64, Xcode 26.6 (17F113), Node 26.0.0, iOS 26.5 Simulator / iPhone 17 Pro**.

**Passed:**

- Simulator build through XcodeBuildMCP `build_sim({})`: zero warnings or errors. Effective defaults: project `apps/ios/StrataMobile.xcodeproj`, scheme `StrataMobile`, Debug configuration, iPhone 17 Pro / iOS 26.5 selected by its local simulator ID, and DerivedData `apps/ios/build`.
- Full unit target through XcodeBuildMCP `test_sim`, with `extraArgs: ["-only-testing:StrataMobileTests", "-parallel-testing-enabled", "NO"]`: **26 passed, 0 failed, 1 skipped**. The skip is the explicitly optional live TLS test without an invitation.
- The repository's portable fixture command below: **1 full workflow passed, 0 failed**; test body 76.839 seconds. It verified actual TLS pairing, saved history, live Thinking and its recorded panel, ordered progress, browser activity, Allow/Deny, continuation, Stop and relaunch. The wrapper's XCTest environment forwarding and owned-process/temporary-key cleanup also completed successfully.

```sh
# Set MAC_CHECKOUT to the separate Mac PR checkout, then run from this checkout.
STRATA_TEST_BRIDGE_MODULE="$MAC_CHECKOUT/apps/companion-bridge/bridge.mjs" \
STRATA_TEST_DERIVED_DATA=apps/ios/build \
node apps/ios/test-support/shared-conversation-fixture.mjs --test \
  'platform=iOS Simulator,name=iPhone 17 Pro'
```

The measured fixture run selected that simulator by its local ID; the command above uses its portable name and substitutes the matching checkout path. The fixture supplies synthetic host data and does not start a real model, browser or desktop agent. See `apps/ios/test-support/README.md` for the reproducible workflow and simulator-pairing side effect.

Preview captured from that synthetic workflow:

<img src="https://raw.githubusercontent.com/jorge123255/strata/pr/ios-companion/apps/ios/docs/shared-conversation.png" alt="iPhone shared conversation with Thinking and ordered progress" width="320">

**Failed:**

None in these fresh checks.

**Not run:**

Physical iPhone interaction or camera pairing against this sanitized branch; iOS 17 or iPad runtime acceptance; App Store/distribution signing; real-model inference or real browser control. Earlier development installation of the complete fork on an iPhone is separate from acceptance of these split upstream revisions.

## Limits

Requires the Mac support in #3347 and iOS 17 or later. Initial pairing uses the same trusted local network. Foreground polling does not provide background notifications or relay access. Browser cards report actions/results; they do not stream the Mac's screen. The app inherits the paired Mac conversation's permissions, including a trusted phone's ability to answer approvals. Contributors must select their own signing team/profile for device installation.

No site

Links install, modelos, releases.