Skip to content

Commit be62091

Browse files
authored
Merge branch 'main' into vincentkoc-code/windows-ci-scope-review
2 parents bbc66b5 + 80efcb7 commit be62091

32 files changed

+129
-121
lines changed

apps/ios/Sources/Camera/CameraController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ actor CameraController {
120120
Self.pickCamera(facing: preferFrontCamera ? .front : .back, deviceId: deviceId)
121121
},
122122
cameraUnavailableError: CameraError.cameraUnavailable,
123-
mapSetupError: Self.mapMovieSetupError) { output in
123+
mapSetupError: Self.mapMovieSetupError,
124+
operation: { output in
124125
var delegate: MovieFileDelegate?
125126
let recordedURL: URL = try await withCheckedThrowingContinuation { cont in
126127
let d = MovieFileDelegate(cont)
@@ -131,7 +132,7 @@ actor CameraController {
131132
// Transcode .mov -> .mp4 for easier downstream handling.
132133
try await Self.exportToMP4(inputURL: recordedURL, outputURL: mp4URL)
133134
return try Data(contentsOf: mp4URL)
134-
}
135+
})
135136
return (
136137
format: format.rawValue,
137138
base64: data.base64EncodedString(),

apps/ios/Sources/Location/LocationService.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class LocationService: NSObject, CLLocationManagerDelegate, LocationServic
2121
self.manager
2222
}
2323

24-
var locationRequestContinuation: CheckedContinuation<CLLocation, Error>? {
24+
var locationRequestContinuation: CheckedContinuation<CLLocation, Swift.Error>? {
2525
get { self.locationContinuation }
2626
set { self.locationContinuation = newValue }
2727
}
@@ -65,9 +65,10 @@ final class LocationService: NSObject, CLLocationManagerDelegate, LocationServic
6565
desiredAccuracy: desiredAccuracy,
6666
maxAgeMs: maxAgeMs,
6767
timeoutMs: timeoutMs,
68-
request: { try await self.requestLocationOnce() }) { timeoutMs, operation in
68+
request: { try await self.requestLocationOnce() },
69+
withTimeout: { timeoutMs, operation in
6970
try await self.withTimeout(timeoutMs: timeoutMs, operation: operation)
70-
}
71+
})
7172
}
7273

7374
private func awaitAuthorizationChange() async -> CLAuthorizationStatus {

apps/ios/Sources/Onboarding/GatewayOnboardingView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,15 @@ private struct ManualEntryStep: View {
302302
// (GatewaySetupCode) decode raw setup codes.
303303
}
304304

305+
@MainActor
305306
private func gatewayConnectionStatusLines(
306307
appModel: NodeAppModel,
307308
gatewayController: GatewayConnectionController) -> [String]
308309
{
309310
ConnectionStatusBox.defaultLines(appModel: appModel, gatewayController: gatewayController)
310311
}
311312

313+
@MainActor
312314
private func resetGatewayConnectionState(
313315
appModel: NodeAppModel,
314316
connectStatusText: inout String?,
@@ -319,6 +321,7 @@ private func resetGatewayConnectionState(
319321
connectingGatewayID = nil
320322
}
321323

324+
@MainActor
322325
@ViewBuilder
323326
private func gatewayConnectionStatusSection(
324327
appModel: NodeAppModel,

apps/ios/Sources/Screen/ScreenRecordService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AVFoundation
2+
import OpenClawKit
23
import ReplayKit
34

45
final class ScreenRecordService: @unchecked Sendable {

apps/ios/Sources/Voice/VoiceWakeManager.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,6 @@ final class VoiceWakeManager: NSObject {
441441
}
442442
}
443443

444-
private static func permissionMessage(
445-
kind: String,
446-
status: AVAudioSession.RecordPermission) -> String
447-
{
448-
self.deniedByDefaultPermissionMessage(kind: kind, isUndetermined: status == .undetermined)
449-
}
450-
451444
private static func permissionMessage(
452445
kind: String,
453446
status: SFSpeechRecognizerAuthorizationStatus) -> String
@@ -466,7 +459,7 @@ final class VoiceWakeManager: NSObject {
466459
}
467460
}
468461

469-
private static func deniedByDefaultPermissionMessage(kind: String, isUndetermined: Bool) -> String {
462+
private nonisolated static func deniedByDefaultPermissionMessage(kind: String, isUndetermined: Bool) -> String {
470463
if isUndetermined {
471464
return "\(kind) permission not granted"
472465
}

apps/macos/Sources/OpenClaw/CameraCaptureService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ actor CameraCaptureService {
164164
}
165165

166166
private func ensureAccess(for mediaType: AVMediaType) async throws {
167-
if !(await CameraAuthorization.isAuthorized(for: mediaType)) {
167+
if await !(CameraAuthorization.isAuthorized(for: mediaType)) {
168168
throw CameraError.permissionDenied(kind: mediaType == .video ? "Camera" : "Microphone")
169169
}
170170
}

apps/macos/Sources/OpenClaw/CanvasFileWatcher.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ final class CanvasFileWatcher: @unchecked Sendable, SimpleFileWatcherOwner {
99
queueLabel: "ai.openclaw.canvaswatcher",
1010
onChange: onChange))
1111
}
12-
1312
}

apps/macos/Sources/OpenClaw/CanvasWindowController+Testing.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,22 @@ extension CanvasWindowController {
2525
}
2626

2727
static func _testParseIPv4(_ host: String) -> (UInt8, UInt8, UInt8, UInt8)? {
28-
LoopbackHost.parseIPv4(host)
28+
let parts = host.split(separator: ".", omittingEmptySubsequences: false)
29+
guard parts.count == 4 else { return nil }
30+
let bytes: [UInt8] = parts.compactMap { UInt8($0) }
31+
guard bytes.count == 4 else { return nil }
32+
return (bytes[0], bytes[1], bytes[2], bytes[3])
2933
}
3034

3135
static func _testIsLocalNetworkIPv4(_ ip: (UInt8, UInt8, UInt8, UInt8)) -> Bool {
32-
LoopbackHost.isLocalNetworkIPv4(ip)
36+
let (a, b, _, _) = ip
37+
if a == 10 { return true }
38+
if a == 172, (16...31).contains(Int(b)) { return true }
39+
if a == 192, b == 168 { return true }
40+
if a == 127 { return true }
41+
if a == 169, b == 254 { return true }
42+
if a == 100, (64...127).contains(Int(b)) { return true }
43+
return false
3344
}
3445

3546
static func _testIsLocalNetworkCanvasURL(_ url: URL) -> Bool {

apps/macos/Sources/OpenClaw/ConfigFileWatcher.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ final class ConfigFileWatcher: @unchecked Sendable, SimpleFileWatcherOwner {
3030
},
3131
onChange: onChange))
3232
}
33-
3433
}

apps/macos/Sources/OpenClaw/ExecSystemRunCommandValidator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ enum ExecSystemRunCommandValidator {
124124

125125
let lower = token.lowercased()
126126
let flag = lower.split(separator: "=", maxSplits: 1).first.map(String.init) ?? lower
127-
if ExecEnvOptions.flagOnly.contains(flag) {
127+
if ExecEnvOptions.flagOnly.contains(flag) {
128128
usesModifiers = true
129129
idx += 1
130130
continue
131131
}
132-
if ExecEnvOptions.withValue.contains(flag) {
132+
if ExecEnvOptions.withValue.contains(flag) {
133133
usesModifiers = true
134134
if !lower.contains("=") {
135135
expectsOptionValue = true

0 commit comments

Comments
 (0)