mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-05 00:01:36 +00:00
* fix(macos): avoid passive Automation prompts * fix(macos): keep Voice Wake recognition on device * fix(macos): require consent for activity presence * chore(apps): refresh native i18n inventory * fix(macos): preserve presence clears across gateway versions * fix(macos): prioritize activity privacy opt-out * chore(apps): refresh native i18n inventory * fix(macos): scrub legacy presence activity * fix(macos): migrate permission status caller * fix(macos): preserve unknown permission state * fix(macos): refresh privacy change artifacts * refactor(macos): remove stale presence helper * fix(deps): patch URI and Jaeger advisories * test(gateway): adopt pairing-bound node sessions
23 lines
681 B
Swift
23 lines
681 B
Swift
import CoreGraphics
|
|
import Foundation
|
|
import OpenClawKit
|
|
|
|
enum SystemPresenceInfo {
|
|
static func lastHardwareInputSeconds() -> Int? {
|
|
self.lastInputSeconds(state: .hidSystemState)
|
|
}
|
|
|
|
private static func lastInputSeconds(state: CGEventSourceStateID) -> Int? {
|
|
let anyEvent = CGEventType(rawValue: UInt32.max) ?? .null
|
|
let seconds = CGEventSource.secondsSinceLastEventType(state, eventType: anyEvent)
|
|
if seconds.isNaN || seconds.isInfinite || seconds < 0 {
|
|
return nil
|
|
}
|
|
return Int(seconds.rounded())
|
|
}
|
|
|
|
static func primaryIPv4Address() -> String? {
|
|
NetworkInterfaces.primaryIPv4Address()
|
|
}
|
|
}
|