Download apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntimeMainActorServices.swift from quinnz/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/spaces/quinnz/openclaw/resolve/main/apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntimeMainActorServices.swift
- Command line
-
hf download hf://spaces/quinnz/openclaw/apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntimeMainActorServices.swift
-
curl -L -o MacNodeRuntimeMainActorServices.swift https://huggingface.co/spaces/quinnz/openclaw/resolve/main/apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntimeMainActorServices.swift
1.86 kB
| import OpenClawKit | |
| import CoreLocation | |
| import Foundation | |
| protocol MacNodeRuntimeMainActorServices: Sendable { | |
| func recordScreen( | |
| screenIndex: Int?, | |
| durationMs: Int?, | |
| fps: Double?, | |
| includeAudio: Bool?, | |
| outPath: String?) async throws -> (path: String, hasAudio: Bool) | |
| func locationAuthorizationStatus() -> CLAuthorizationStatus | |
| func locationAccuracyAuthorization() -> CLAccuracyAuthorization | |
| func currentLocation( | |
| desiredAccuracy: OpenClawLocationAccuracy, | |
| maxAgeMs: Int?, | |
| timeoutMs: Int?) async throws -> CLLocation | |
| } | |
| final class LiveMacNodeRuntimeMainActorServices: MacNodeRuntimeMainActorServices, @unchecked Sendable { | |
| private let screenRecorder = ScreenRecordService() | |
| private let locationService = MacNodeLocationService() | |
| func recordScreen( | |
| screenIndex: Int?, | |
| durationMs: Int?, | |
| fps: Double?, | |
| includeAudio: Bool?, | |
| outPath: String?) async throws -> (path: String, hasAudio: Bool) | |
| { | |
| try await self.screenRecorder.record( | |
| screenIndex: screenIndex, | |
| durationMs: durationMs, | |
| fps: fps, | |
| includeAudio: includeAudio, | |
| outPath: outPath) | |
| } | |
| func locationAuthorizationStatus() -> CLAuthorizationStatus { | |
| self.locationService.authorizationStatus() | |
| } | |
| func locationAccuracyAuthorization() -> CLAccuracyAuthorization { | |
| self.locationService.accuracyAuthorization() | |
| } | |
| func currentLocation( | |
| desiredAccuracy: OpenClawLocationAccuracy, | |
| maxAgeMs: Int?, | |
| timeoutMs: Int?) async throws -> CLLocation | |
| { | |
| try await self.locationService.currentLocation( | |
| desiredAccuracy: desiredAccuracy, | |
| maxAgeMs: maxAgeMs, | |
| timeoutMs: timeoutMs) | |
| } | |
| } | |