[PR #3348] [GUI] Add an iPhone companion with shared chats and model downloads #4583

Open
opened 2026-11-07 15:37:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3348
Author: @jorge123255
Created: 10/20/2026
Status: 🔄 Open

Base: main ← Head: pr/ios-companion


📝 Commits (4)

  • 680bc50 [GUI] Add optional iPhone companion for shared Mac conversations
  • af6da40 [Docs] Explain iPhone companion prerequisites and show preview
  • a6b503a [GUI] Add model download controls for paired and remote Strata computers
  • a7ca6da [Docs] Describe SSH-managed Terminal model download targets

📊 Changes

34 files changed (+5807 additions, -0 deletions)

View changed files

📝 README.md (+11 -0)
➕ apps/ios/.gitignore (+5 -0)
➕ apps/ios/README.md (+89 -0)
➕ apps/ios/StrataMobile.xcodeproj/project.pbxproj (+593 -0)
➕ apps/ios/StrataMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata (+7 -0)
➕ apps/ios/StrataMobile.xcodeproj/xcshareddata/xcschemes/StrataMobile.xcscheme (+113 -0)
➕ apps/ios/StrataMobile/Assets.xcassets/AppIcon.appiconset/AppIcon.png (+0 -0)
➕ apps/ios/StrataMobile/Assets.xcassets/AppIcon.appiconset/Contents.json (+1 -0)
➕ apps/ios/StrataMobile/Assets.xcassets/Contents.json (+1 -0)
➕ apps/ios/StrataMobile/Info.plist (+18 -0)
➕ apps/ios/StrataMobile/Models/CompanionModels.swift (+424 -0)
➕ apps/ios/StrataMobile/Services/CompanionClient.swift (+166 -0)
➕ apps/ios/StrataMobile/Services/CompanionStore.swift (+572 -0)
➕ apps/ios/StrataMobile/Services/QRScannerView.swift (+81 -0)
➕ apps/ios/StrataMobile/StrataMobileApp.swift (+26 -0)
➕ apps/ios/StrataMobile/Theme.swift (+74 -0)
➕ apps/ios/StrataMobile/Views/ChatView.swift (+368 -0)
➕ apps/ios/StrataMobile/Views/Components.swift (+197 -0)
➕ apps/ios/StrataMobile/Views/ConnectionView.swift (+341 -0)
➕ apps/ios/StrataMobile/Views/ContentView.swift (+63 -0)

...and 14 more files

📄 Description

Problem and result

Strata's Mac conversations cannot currently be continued from a native iPhone app. This adds an optional SwiftUI companion in Strata's light/dark palette: pair, reopen shared history, continue the same chat, expand Thinking, follow ordered progress/browser/tool activity, answer approvals or Stop. The Models screen also reviews, starts and follows downloads on the paired Mac or its saved compatible Strata connections.

Scope proposal #3346; runtime dependency #3347 supplies the authenticated bridge, shared conversations and model-management API. Both branches share the upstream base without duplicating Mac changes. Maintainer scope agreement remains pending; both PRs are drafts.

Approach

  • Scan a five-minute one-use invitation or enter it manually. Pin the exact TLS certificate before transmitting credentials, reject redirects and save pairing in the device-only Keychain. Camera access is optional.
  • Inherit a Mac chat's model, workspace and permission mode. Preserve earlier phone-only text chats. Foreground polling retains the order of Thinking, reply paragraphs, progress groups and activity/approval cards; leaving the phone does not stop accepted work.
  • Keep the existing loaded/API library and add a separate download catalog with destination selection. Review size/free/needed storage, picture reading, unloading/engine steps and expiry before explicit confirmation. Show progress, owner-scoped Stop and fresh-plan retry. Files remain on the destination; API credentials and SSH settings stay on the Mac. Terminal servers inherit the Mac’s optional per-connection SSH transport. The phone manages downloads; file imports, preparation and managed-API switching are available in the Mac controls in #3347. These Mac lifecycle additions do not change this iOS client source.
  • Reject stale connection/target/review/poll responses and handle a disappearing target safely during SwiftUI updates. Older Mac management APIs show update guidance without removing the existing library. Management requests get a separate 180-second timeout; ordinary requests retain 20 seconds.
  • Include reproducible synthetic fixtures using the actual TLS bridge and authentication. No personal signing team, provisioning profile, credentials or local deployment reports are included. Device installation uses the contributor's own team/profile.

Validation

Public HEAD a7ca6da2aa adds SSH setup documentation only. The app/resources/tests remain byte-identical to freshly validated sanitized revision a6b503a984, based on e88ee39d. macOS 26.5 arm64; Xcode 26.6 (17F113); iOS 26.5 Simulator / iPhone 17 Pro. All 23 app/resource/test/new-fixture files match the tested full-fork source 432a8910 byte-for-byte. Build 5; signing metadata and documentation are sanitized.

Passed:

  • Public revision: XcodeBuildMCP build_sim({}), zero warnings/errors. Effective defaults: apps/ios/StrataMobile.xcodeproj, StrataMobile scheme, Debug, iPhone 17 Pro / iOS 26.5 selected by local simulator ID, isolated DerivedData.
  • Public revision: test_sim({extraArgs:["-only-testing:StrataMobileTests","-parallel-testing-enabled","NO"]}): 38 passed, 0 failed, 1 skipped. The skip is the explicitly optional live TLS test without an invitation. Coverage includes typed picture-reading requests, target/connection/review races, lost polling responses, older API fallback, empty-target picker safety and timeout selection.
  • Byte-identical full-fork source: two complete real-TLS UI workflows passed using the companion fixture and Mac bridge source 4e2f599a. Download workflow: 79.173-second test body; review/vision/no implicit start, progress/Stop, fresh retry/error, remote target start/completion, relaunch, old-host fallback/library retention. Shared-chat workflow: 77.081-second test body; history, Thinking/ordered progress, browser Allow/Deny, continuation, Stop, scroll and relaunch. Owned listeners/temp identities were cleaned up. Simulator pairing was test-only; no physical phone was changed by these tests.

Reproduction from the repository root, with MAC_CHECKOUT pointing to the matching Mac PR checkout:

STRATA_TEST_BRIDGE_MODULE="$MAC_CHECKOUT/apps/companion-bridge/bridge.mjs" \
  node apps/ios/test-support/companion-fixture.mjs --test-downloads \
  'platform=iOS Simulator,name=iPhone 17 Pro'
STRATA_TEST_BRIDGE_MODULE="$MAC_CHECKOUT/apps/companion-bridge/bridge.mjs" \
  node apps/ios/test-support/companion-fixture.mjs --test \
  'platform=iOS Simulator,name=iPhone 17 Pro'
git diff --check

The measured UI runs used that simulator's local ID and an isolated DerivedData override. These complete UI cases were not repeated in the public checkout; fresh public build/units and file-hash equality are the exact split-revision evidence. Fixtures supply synthetic host/model state and start no real model download, inference, browser or desktop agent. Keep XCTest bundles private because entered pairing fields can be recorded.

Synthetic iPhone conversation with Thinking and ordered progress

Failed:

None in final checks. Development UI testing caught and fixed identifier propagation into controls and an index-out-of-range picker binding when targets disappeared; the final workflow/regression passed.

Not run:

Physical iPhone interaction or camera pairing against this public revision; iOS 17/iPad runtime acceptance; App Store distribution; real model downloads, inference or browser control. The signed development build 5 of the full fork was subsequently installed, and a read-only device query confirmed its bundle/build. It was deliberately left closed for the user; this is installation evidence only. No physical acceptance is inferred from simulator checks.

Limits

Requires iOS 17+ and #3347. Desktop API targets must implement and explicitly enable the matching administration extension. Terminal servers can instead use SSH configured per saved connection in the Mac app; no SSH host/user/key details are sent to the phone. SSH downloads do not prepare/load models or stop the serving model. An inference API key alone grants no SSH access. Pairing is local-network. Foreground polling does not provide background notifications/relay access; browser cards show actions/results, not screen video. Downloads/imports are not automatically loaded. The phone inherits paired conversation permissions, including approval control. See apps/ios/README.md and apps/ios/test-support/README.md.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3348 **Author:** [@jorge123255](https://github.com/jorge123255) **Created:** 10/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/ios-companion` --- ### 📝 Commits (4) - [`680bc50`](https://github.com/Niko1221/Strata/commit/680bc505ba318ab75367be25efc579132f1d538a) [GUI] Add optional iPhone companion for shared Mac conversations - [`af6da40`](https://github.com/Niko1221/Strata/commit/af6da40e952403dada2c46135014c86b428fcbf2) [Docs] Explain iPhone companion prerequisites and show preview - [`a6b503a`](https://github.com/Niko1221/Strata/commit/a6b503a98499d308f60415fb031f0e37a132ef2c) [GUI] Add model download controls for paired and remote Strata computers - [`a7ca6da`](https://github.com/Niko1221/Strata/commit/a7ca6da2aa24b9bf646759a1ed281733046d3809) [Docs] Describe SSH-managed Terminal model download targets ### 📊 Changes **34 files changed** (+5807 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+11 -0) ➕ `apps/ios/.gitignore` (+5 -0) ➕ `apps/ios/README.md` (+89 -0) ➕ `apps/ios/StrataMobile.xcodeproj/project.pbxproj` (+593 -0) ➕ `apps/ios/StrataMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata` (+7 -0) ➕ `apps/ios/StrataMobile.xcodeproj/xcshareddata/xcschemes/StrataMobile.xcscheme` (+113 -0) ➕ `apps/ios/StrataMobile/Assets.xcassets/AppIcon.appiconset/AppIcon.png` (+0 -0) ➕ `apps/ios/StrataMobile/Assets.xcassets/AppIcon.appiconset/Contents.json` (+1 -0) ➕ `apps/ios/StrataMobile/Assets.xcassets/Contents.json` (+1 -0) ➕ `apps/ios/StrataMobile/Info.plist` (+18 -0) ➕ `apps/ios/StrataMobile/Models/CompanionModels.swift` (+424 -0) ➕ `apps/ios/StrataMobile/Services/CompanionClient.swift` (+166 -0) ➕ `apps/ios/StrataMobile/Services/CompanionStore.swift` (+572 -0) ➕ `apps/ios/StrataMobile/Services/QRScannerView.swift` (+81 -0) ➕ `apps/ios/StrataMobile/StrataMobileApp.swift` (+26 -0) ➕ `apps/ios/StrataMobile/Theme.swift` (+74 -0) ➕ `apps/ios/StrataMobile/Views/ChatView.swift` (+368 -0) ➕ `apps/ios/StrataMobile/Views/Components.swift` (+197 -0) ➕ `apps/ios/StrataMobile/Views/ConnectionView.swift` (+341 -0) ➕ `apps/ios/StrataMobile/Views/ContentView.swift` (+63 -0) _...and 14 more files_ </details> ### 📄 Description ## Problem and result Strata's Mac conversations cannot currently be continued from a native iPhone app. This adds an optional SwiftUI companion in Strata's light/dark palette: pair, reopen shared history, continue the same chat, expand Thinking, follow ordered progress/browser/tool activity, answer approvals or Stop. The Models screen also reviews, starts and follows downloads on the paired Mac or its saved compatible Strata connections. ## Related discussion Scope proposal #3346; runtime dependency #3347 supplies the authenticated bridge, shared conversations and model-management API. Both branches share the upstream base without duplicating Mac changes. Maintainer scope agreement remains pending; both PRs are drafts. ## Approach - Scan a five-minute one-use invitation or enter it manually. Pin the exact TLS certificate before transmitting credentials, reject redirects and save pairing in the device-only Keychain. Camera access is optional. - Inherit a Mac chat's model, workspace and permission mode. Preserve earlier phone-only text chats. Foreground polling retains the order of Thinking, reply paragraphs, progress groups and activity/approval cards; leaving the phone does not stop accepted work. - Keep the existing loaded/API library and add a separate download catalog with destination selection. Review size/free/needed storage, picture reading, unloading/engine steps and expiry before explicit confirmation. Show progress, owner-scoped Stop and fresh-plan retry. Files remain on the destination; API credentials and SSH settings stay on the Mac. Terminal servers inherit the Mac’s optional per-connection SSH transport. The phone manages downloads; file imports, preparation and managed-API switching are available in the Mac controls in #3347. These Mac lifecycle additions do not change this iOS client source. - Reject stale connection/target/review/poll responses and handle a disappearing target safely during SwiftUI updates. Older Mac management APIs show update guidance without removing the existing library. Management requests get a separate 180-second timeout; ordinary requests retain 20 seconds. - Include reproducible synthetic fixtures using the actual TLS bridge and authentication. No personal signing team, provisioning profile, credentials or local deployment reports are included. Device installation uses the contributor's own team/profile. ## Validation Public HEAD **a7ca6da2aa24b9bf646759a1ed281733046d3809** adds SSH setup documentation only. The app/resources/tests remain byte-identical to freshly validated sanitized revision **a6b503a98499d308f60415fb031f0e37a132ef2c**, based on **e88ee39d**. macOS 26.5 arm64; Xcode 26.6 (17F113); iOS 26.5 Simulator / iPhone 17 Pro. All 23 app/resource/test/new-fixture files match the tested full-fork source **432a8910** byte-for-byte. Build 5; signing metadata and documentation are sanitized. **Passed:** - Public revision: XcodeBuildMCP `build_sim({})`, zero warnings/errors. Effective defaults: `apps/ios/StrataMobile.xcodeproj`, `StrataMobile` scheme, Debug, iPhone 17 Pro / iOS 26.5 selected by local simulator ID, isolated DerivedData. - Public revision: `test_sim({extraArgs:["-only-testing:StrataMobileTests","-parallel-testing-enabled","NO"]})`: **38 passed, 0 failed, 1 skipped**. The skip is the explicitly optional live TLS test without an invitation. Coverage includes typed picture-reading requests, target/connection/review races, lost polling responses, older API fallback, empty-target picker safety and timeout selection. - Byte-identical full-fork source: **two complete real-TLS UI workflows passed** using the companion fixture and Mac bridge source **4e2f599a**. Download workflow: 79.173-second test body; review/vision/no implicit start, progress/Stop, fresh retry/error, remote target start/completion, relaunch, old-host fallback/library retention. Shared-chat workflow: 77.081-second test body; history, Thinking/ordered progress, browser Allow/Deny, continuation, Stop, scroll and relaunch. Owned listeners/temp identities were cleaned up. Simulator pairing was test-only; no physical phone was changed by these tests. Reproduction from the repository root, with `MAC_CHECKOUT` pointing to the matching Mac PR checkout: ```sh STRATA_TEST_BRIDGE_MODULE="$MAC_CHECKOUT/apps/companion-bridge/bridge.mjs" \ node apps/ios/test-support/companion-fixture.mjs --test-downloads \ 'platform=iOS Simulator,name=iPhone 17 Pro' STRATA_TEST_BRIDGE_MODULE="$MAC_CHECKOUT/apps/companion-bridge/bridge.mjs" \ node apps/ios/test-support/companion-fixture.mjs --test \ 'platform=iOS Simulator,name=iPhone 17 Pro' git diff --check ``` The measured UI runs used that simulator's local ID and an isolated DerivedData override. These complete UI cases were not repeated in the public checkout; fresh public build/units and file-hash equality are the exact split-revision evidence. Fixtures supply synthetic host/model state and start no real model download, inference, browser or desktop agent. Keep XCTest bundles private because entered pairing fields can be recorded. <img src="https://raw.githubusercontent.com/jorge123255/strata/pr/ios-companion/apps/ios/docs/shared-conversation.png" alt="Synthetic iPhone conversation with Thinking and ordered progress" width="320"> **Failed:** None in final checks. Development UI testing caught and fixed identifier propagation into controls and an index-out-of-range picker binding when targets disappeared; the final workflow/regression passed. **Not run:** Physical iPhone interaction or camera pairing against this public revision; iOS 17/iPad runtime acceptance; App Store distribution; real model downloads, inference or browser control. The signed development build 5 of the full fork was subsequently installed, and a read-only device query confirmed its bundle/build. It was deliberately left closed for the user; this is installation evidence only. No physical acceptance is inferred from simulator checks. ## Limits Requires iOS 17+ and #3347. Desktop API targets must implement and explicitly enable the matching administration extension. Terminal servers can instead use SSH configured per saved connection in the Mac app; no SSH host/user/key details are sent to the phone. SSH downloads do not prepare/load models or stop the serving model. An inference API key alone grants no SSH access. Pairing is local-network. Foreground polling does not provide background notifications/relay access; browser cards show actions/results, not screen video. Downloads/imports are not automatically loaded. The phone inherits paired conversation permissions, including approval control. See `apps/ios/README.md` and `apps/ios/test-support/README.md`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4583
No description provided.