Files
openclaw/apps/ios/Sources/Voice/TalkGatewayPermissionState.swift
Colin Johnson f6e51ff99a feat(ios): refresh pro UI and gateway flows (#87367)
Summary:
- Replace the legacy iOS shell with Pro Command, Chat, Agents, and Settings tabs.
- Wire iOS chat/session/settings/diagnostics and realtime Talk flows through gateway-backed APIs.
- Add gateway/session and shared chat coverage for the new iOS flow.

Verification:
- git diff --check
- node scripts/run-vitest.mjs src/gateway/server.sessions.create.test.ts src/gateway/talk-realtime-relay.test.ts
- swift test --filter ChatViewModelTests (apps/shared/OpenClawKit)
- xcodebuild build for Nimrod's iPhone succeeded; install succeeded; launch was blocked because the phone was locked

Known follow-up:
- Preserve traceLevel in sessions.create parent runtime inheritance and keep the changelog credit in the follow-up patch.
2026-05-28 17:23:26 +03:00

64 lines
1.5 KiB
Swift

enum TalkGatewayPermissionState: Equatable {
case unknown
case ready
case missingScope(String)
case requestingUpgrade
case upgradeRequested(requestId: String?)
case requestFailed(String)
case apiKeyMissing
case loadFailed(String)
var statusLabel: String {
switch self {
case .unknown:
"Not checked"
case .ready:
"Ready"
case let .missingScope(scope):
"Missing \(scope)"
case .requestingUpgrade:
"Requesting approval"
case .upgradeRequested:
"Approval requested"
case .requestFailed:
"Request failed"
case .apiKeyMissing:
"API key missing"
case .loadFailed:
"Load failed"
}
}
var requiresTalkPermissionAction: Bool {
switch self {
case .missingScope, .requestingUpgrade, .upgradeRequested, .requestFailed:
true
default:
false
}
}
var isApprovalRequestInProgress: Bool {
switch self {
case .requestingUpgrade, .upgradeRequested:
true
default:
false
}
}
var failureMessage: String? {
if case let .requestFailed(message) = self {
return message
}
return nil
}
var requestId: String? {
if case let .upgradeRequested(requestId) = self {
return requestId
}
return nil
}
}