input-capture: public init for PermissionState (app-engine request 1)

Cross-lane edit, authorised by the lead. The struct declared two public
lets and no init, so the memberwise one was internal and no other target
could build a value — `EngineSnapshot.permissions` had to default to
`Permissions.preflight()`, i.e. a TCC query, just to have a value to
hold. The default is now `PermissionState(listen: false, post: false)`,
which is also the honest value before `start()` has read anything.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
lucioandClaude Opus 5 committed 2026-09-16 03:57:27 -07:00
1 parent 8125cb1ede
commit 76d1053aaf
3 files changed
+16 -3

No files matched your search

+3 -2
View File
@@ -62,8 +62,9 @@ public struct EngineSnapshot: Sendable {
public var controlled: String?
/// Whether ALL-machines mode is on.
public var broadcasting = false
/// Input Monitoring / Accessibility as macOS reports them.
public var permissions = Permissions.preflight()
/// Input Monitoring / Accessibility as macOS reports them. The default is
/// "neither", not a `preflight()`: building a snapshot must not query TCC.
public var permissions = PermissionState(listen: false, post: false)
/// Whether the event tap is installed.
public var tapRunning = false
/// False when the process could not make a `CGEventSource`, so nothing this