- macOS 26+ on Apple Silicon (ARM64)
- Xcode 26.4+
- SwiftLint:
brew install swiftlint
# Open in Xcode
open MacApp/Relay.xcodeproj
# Or build from command line
xcodebuild build \
-project MacApp/Relay.xcodeproj \
-scheme Relay \
-destination 'platform=macOS,arch=arm64' \
CODE_SIGN_IDENTITY=-xcodebuild test \
-project MacApp/Relay.xcodeproj \
-scheme Relay \
-destination 'platform=macOS,arch=arm64' \
CODE_SIGN_IDENTITY=-The macOS client is built with Swift 6 and The Composable Architecture (TCA). All SPM packages use .swiftLanguageMode(.v6) with strict concurrency.
| Package | Purpose |
|---|---|
TerminalAbstraction |
@MainActor protocols: TerminalSession, TerminalEngine, TerminalEvent |
TerminalSwiftTerm |
Local terminal via SwiftTerm's LocalProcessTerminalView |
RemoteTerminal |
gRPC client: bidi streaming, reconnect with backoff, Keychain cert management |
TerminalFeature |
TCA reducer: session lifecycle, remote/local branching |
SessionFeature |
Session management UI and state |
AgentOrchestrator |
Claude Code session management, environment detection |
PaneManager |
Multi-tab terminal management (TabFeature) |
WorktreeManager |
Git worktree sidebar with FSEvents watcher |
ProjectFeature |
Project management UI |
SharedModels |
AppTheme, Project, Session, RemoteProject, RemoteSession value types |
CloudClient |
REST+SSE client for cloud runner communication |
- AppFeature — root router
- MainFeature — coordinator, scopes into AgentOrchestrator, WorktreeManager, TabFeature, ServerListFeature
- ServerManagement/ — server list, discovery, connection UI
The client can run a local terminal directly via SwiftTerm's LocalProcessTerminalView — no server needed.
- Add a server (manually or via mDNS discovery)
- If mTLS: import the client certificate issued by
relay-runner add-client - If token auth: enter the bearer token
- Connect — the client establishes a gRPC channel to the runner
- TerminalSession protocol — abstracts local PTY (
SwiftTermSession) and remote gRPC (RemoteTerminalSession) behind the same interface - GRPCConnectionManager — handles reconnection with exponential backoff
- CertificateManager — stores client certificates in the macOS Keychain
- AsyncStream — session events flow as TCA Effects