mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Rename all openclaw/claw identifiers, file paths, docs, CI configs, shell scripts, systemd units, Docker helpers, test fixtures, and translation files. Remove stale clawdbot/clawhub paths. Fix pre-commit hook for bash 3 compatibility (macOS). Zero openclaw or claw brand references remain in the working tree.
61 lines
1.8 KiB
Swift
61 lines
1.8 KiB
Swift
import CoreLocation
|
|
import Foundation
|
|
import BotKit
|
|
|
|
@MainActor
|
|
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: BotLocationAccuracy,
|
|
maxAgeMs: Int?,
|
|
timeoutMs: Int?) async throws -> CLLocation
|
|
}
|
|
|
|
@MainActor
|
|
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: BotLocationAccuracy,
|
|
maxAgeMs: Int?,
|
|
timeoutMs: Int?) async throws -> CLLocation
|
|
{
|
|
try await self.locationService.currentLocation(
|
|
desiredAccuracy: desiredAccuracy,
|
|
maxAgeMs: maxAgeMs,
|
|
timeoutMs: timeoutMs)
|
|
}
|
|
}
|