mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 720791ae6b
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
94 lines
3.4 KiB
Swift
94 lines
3.4 KiB
Swift
import CoreLocation
|
|
import Foundation
|
|
import OpenClawKit
|
|
import UIKit
|
|
|
|
protocol CameraServicing: Sendable {
|
|
func listDevices() async -> [CameraController.CameraDeviceInfo]
|
|
func snap(params: OpenClawCameraSnapParams) async throws -> (format: String, base64: String, width: Int, height: Int)
|
|
func clip(params: OpenClawCameraClipParams) async throws -> (format: String, base64: String, durationMs: Int, hasAudio: Bool)
|
|
}
|
|
|
|
protocol ScreenRecordingServicing: Sendable {
|
|
func record(
|
|
screenIndex: Int?,
|
|
durationMs: Int?,
|
|
fps: Double?,
|
|
includeAudio: Bool?,
|
|
outPath: String?) async throws -> String
|
|
}
|
|
|
|
@MainActor
|
|
protocol LocationServicing: Sendable {
|
|
func authorizationStatus() -> CLAuthorizationStatus
|
|
func accuracyAuthorization() -> CLAccuracyAuthorization
|
|
func ensureAuthorization(mode: OpenClawLocationMode) async -> CLAuthorizationStatus
|
|
func currentLocation(
|
|
params: OpenClawLocationGetParams,
|
|
desiredAccuracy: OpenClawLocationAccuracy,
|
|
maxAgeMs: Int?,
|
|
timeoutMs: Int?) async throws -> CLLocation
|
|
func startLocationUpdates(
|
|
desiredAccuracy: OpenClawLocationAccuracy,
|
|
significantChangesOnly: Bool) -> AsyncStream<CLLocation>
|
|
func stopLocationUpdates()
|
|
func startMonitoringSignificantLocationChanges(onUpdate: @escaping @Sendable (CLLocation) -> Void)
|
|
func stopMonitoringSignificantLocationChanges()
|
|
}
|
|
|
|
protocol DeviceStatusServicing: Sendable {
|
|
func status() async throws -> OpenClawDeviceStatusPayload
|
|
func info() -> OpenClawDeviceInfoPayload
|
|
}
|
|
|
|
protocol PhotosServicing: Sendable {
|
|
func latest(params: OpenClawPhotosLatestParams) async throws -> OpenClawPhotosLatestPayload
|
|
}
|
|
|
|
protocol ContactsServicing: Sendable {
|
|
func search(params: OpenClawContactsSearchParams) async throws -> OpenClawContactsSearchPayload
|
|
func add(params: OpenClawContactsAddParams) async throws -> OpenClawContactsAddPayload
|
|
}
|
|
|
|
protocol CalendarServicing: Sendable {
|
|
func events(params: OpenClawCalendarEventsParams) async throws -> OpenClawCalendarEventsPayload
|
|
func add(params: OpenClawCalendarAddParams) async throws -> OpenClawCalendarAddPayload
|
|
}
|
|
|
|
protocol RemindersServicing: Sendable {
|
|
func list(params: OpenClawRemindersListParams) async throws -> OpenClawRemindersListPayload
|
|
func add(params: OpenClawRemindersAddParams) async throws -> OpenClawRemindersAddPayload
|
|
}
|
|
|
|
protocol MotionServicing: Sendable {
|
|
func activities(params: OpenClawMotionActivityParams) async throws -> OpenClawMotionActivityPayload
|
|
func pedometer(params: OpenClawPedometerParams) async throws -> OpenClawPedometerPayload
|
|
}
|
|
|
|
struct WatchMessagingStatus: Sendable, Equatable {
|
|
var supported: Bool
|
|
var paired: Bool
|
|
var appInstalled: Bool
|
|
var reachable: Bool
|
|
var activationState: String
|
|
}
|
|
|
|
struct WatchNotificationSendResult: Sendable, Equatable {
|
|
var deliveredImmediately: Bool
|
|
var queuedForDelivery: Bool
|
|
var transport: String
|
|
}
|
|
|
|
protocol WatchMessagingServicing: AnyObject, Sendable {
|
|
func status() async -> WatchMessagingStatus
|
|
func sendNotification(
|
|
id: String,
|
|
title: String,
|
|
body: String,
|
|
priority: OpenClawNotificationPriority?) async throws -> WatchNotificationSendResult
|
|
}
|
|
|
|
extension CameraController: CameraServicing {}
|
|
extension ScreenRecordService: ScreenRecordingServicing {}
|
|
extension LocationService: LocationServicing {}
|