Summary
Create apps/traverse-starter/ios-swift/ — a native iOS client for the traverse-starter reference app using SwiftUI and URLSession. Phase 1 uses the same HTTP polling approach as web-react (POST execute → GET poll → render result). SSE subscription is the phase 2 upgrade path once Traverse ships the state machine.
Phase 1 scope (HTTP polling — unblocked)
- Native iOS app that calls the Traverse HTTP/JSON API
- Text input →
POST /v1/workspaces/{workspace}/execute → poll until complete → display output
- Runtime URL + workspace configurable via Settings screen
- Health check (GET /health) shown as status indicator
- Mirrors
web-react behaviour exactly — same API calls, same output fields
Stack
| Concern |
Choice |
| Language |
Swift 6 |
| UI framework |
SwiftUI |
| HTTP |
URLSession (no third-party dependencies) |
| Min target |
iOS 17 |
| Architecture |
MVVM — ExecutionViewModel owns idle→loading→polling→done state |
Directory structure
apps/traverse-starter/ios-swift/
TraverseStarter.xcodeproj/
TraverseStarter/
TraverseClient.swift # URLSession HTTP client (execute + poll)
ExecutionViewModel.swift # ObservableObject — idle/loading/polling/done
ContentView.swift # Main SwiftUI view
SettingsView.swift # Runtime URL + workspace config
Assets.xcassets/
Info.plist
TraverseStarterTests/
TraverseClientTests.swift
ExecutionViewModelTests.swift
UI screens
Settings (first launch)
- Text field: Runtime URL (e.g.
http://192.168.1.42:8787)
- Text field: Workspace (default:
local-default)
- Save button
Main screen
- Runtime status indicator (Online / Offline)
TextEditor for note input
- Submit button — disabled when offline or state ≠ idle
- Output section — title, tags, noteType, suggestedNextAction, status
- Trace section — expandable list of trace events
- Reset button
Phase 2 upgrade path (do not implement now)
When Traverse ships #525 (state machine), #526 (SSE), and #527 (command dispatch):
- Replace
ExecutionViewModel polling loop with URLSessionDataDelegate SSE subscription
- Replace
execute() call with sendCommand("submit", { note })
AppStateViewModel receives state_changed events — zero local transition logic
- QR code URL provisioning (Traverse #523)
dev-any auth for real device on WiFi (Traverse #524)
Definition of Done
Summary
Create
apps/traverse-starter/ios-swift/— a native iOS client for thetraverse-starterreference app using SwiftUI and URLSession. Phase 1 uses the same HTTP polling approach asweb-react(POST execute → GET poll → render result). SSE subscription is the phase 2 upgrade path once Traverse ships the state machine.Phase 1 scope (HTTP polling — unblocked)
POST /v1/workspaces/{workspace}/execute→ poll until complete → display outputweb-reactbehaviour exactly — same API calls, same output fieldsStack
ExecutionViewModelowns idle→loading→polling→done stateDirectory structure
UI screens
Settings (first launch)
http://192.168.1.42:8787)local-default)Main screen
TextEditorfor note inputPhase 2 upgrade path (do not implement now)
When Traverse ships #525 (state machine), #526 (SSE), and #527 (command dispatch):
ExecutionViewModelpolling loop withURLSessionDataDelegateSSE subscriptionexecute()call withsendCommand("submit", { note })AppStateViewModelreceivesstate_changedevents — zero local transition logicdev-anyauth for real device on WiFi (Traverse #524)Definition of Done
TraverseClientandExecutionViewModelios-swift/covering: prerequisites, runtime URL config, build and run on simulatorscripts/ci/repository_checks.shupdated to acknowledgeios-swift/directory