Files
openclaw/apps/macos/Sources/OpenClaw/SystemPresenceInfo.swift
Peter Steinberger c84921634d fix(macos): require explicit consent for privacy-sensitive access (#112321)
* 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
2026-07-21 15:28:13 -07:00

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()
}
}