You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f527df9
Browse filesBrowse the repository at this point in the historyBrowse files
feat(remote): add a host-allocated macos-app lease backend (#3236)
* feat(remote): add a host-allocated macos-app lease backend
A macos-app lease confines a proxy client to one macOS app, named by bundle id and optionally pinned to a pid. Only the host allocates it, over the loopback /admin/leases route with the daemon token. Request admission refuses other apps, non-app surfaces, full-screen capture and commands outside an allow list, and requires the native app backend. A session under the lease holds its app rather than the host Mac. A daemon policy leases.require refuses requests that name no lease, and /health advertises leaseBackends. Refs #3229.
* fix(remote): refuse device selectors and require platform macos under a macos-app lease
* fix(daemon): confine lease-exempt commands under a macos-app lease
Commands declare appLease: 'allowed' in the command registry, which replaces the
local macos-app allow list. Lease admission now checks it before the
leaseAdmissionExempt early return whenever the daemon policy requires a lease or
the request or its session names a macos-app lease, so doctor, session_list,
devices and the other exempt commands are refused there; only lease_heartbeat
and lease_release pass. leases.require accepts only macos-app.
* fix(daemon): require the leased app session under a macos-app lease
A request under a macos-app lease that named no existing session resolved the
host Mac from its flags and ran with no app bundle id, so a sessionless
snapshot or screenshot was not confined to the leased app. Every request but
open, the batch envelope, lease_heartbeat and lease_release must now run in an
existing session of the leased app, and is otherwise refused with
MACOS_APP_LEASE_DENIED and rule session. Batch steps re-enter request admission
with the daemon policy, so a step that runs before open is refused the same way.
* refactor(daemon): share the host admin JSON body reader and sender
* refactor(daemon): take the macos-app claim exemption from the device claim rule
deviceClaimRuleForOwner now also reads the admitted lease and returns none for
a macos-app lease, so session open no longer keys its claim carve-out on the
lease backend. The open conflict helper moves above the doc block that belongs
to findNewSessionDeviceConflict.
* refactor(remote): share the remote temp artifact path shape with the macos-app lease
* refactor: derive the lease backend enums from LEASE_BACKENDS
* fix(daemon): cap tenant heartbeats of a host-allocated lease at the host window
* fix(daemon): advertise the macos-app lease backend only on a macOS host
* fix(macos-helper): act only inside the session app's windows on the native backend
The native backend's hit test runs on the app's accessibility tree, which also
holds the app's menu bar, and the menu bar's Apple menu acts for the whole Mac
(Sleep, Lock Screen, Recent Items). press, focus and fill now refuse a point
outside every window the app owns, and a resolved target inside its menu bar,
with no-accessible-target.
* refactor(remote): keep the remote temp artifact path shape inside daemon-artifacts
* fix(daemon): omit host paths and the host device from macos-app lease responses
Under a macos-app lease, open no longer returns the session state and log paths or the device, and redacts its warnings and initial snapshot failure. A failure no longer returns logPath or diagnosticsRecord and has host paths and the host name replaced in its text. A snapshot's fallback screenshot path stays on the host. The request diagnostics route is not served to a tenant that held the lease, nor by a daemon that requires one.
* fix(remote): bind the host-allocated macos-app lease on connect
* fix(remote): never release a host-allocated macos-app lease from a tenant
A macos-app lease is allocated and ended only by the host administrator. Disconnect and a forced reconnect now skip lease_release for it, the daemon refuses a tenant lease_release with MACOS_APP_LEASE_HOST_OWNED, and a same-session connect that names a different macos-app lease id needs --force.
* docs(remote): say a tenant cannot release a host-allocated macos-app lease
Copy file name to clipboardExpand all lines: docs/adr/0031-macos-native-app-backend.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,8 +61,10 @@ the background. A dropped post still reports success, and a fallback that cannot
61
61
work would turn "nothing happened" into success, so pointer actions have no event fallback until
62
62
an event path verifies its outcome.
63
63
64
-
**Target resolution.** The helper hit-tests inside the session app (other apps' windows above it do
65
-
not answer) and walks at most four ancestors for a text input or a pressable control role.
64
+
**Target resolution.** The helper acts only on a point inside one of the session app's own on-screen
65
+
windows (its menus and sheets included) and never on its menu bar, whose Apple menu acts for the whole Mac
66
+
(Sleep, Lock Screen, Recent Items); other points are refused with `no-accessible-target`. It
67
+
hit-tests inside the session app (other apps' windows above it do not answer) and walks at most four ancestors for a text input or a pressable control role.
66
68
Chromium answers a hit test with wrapper groups that all claim `AXPress`, so when the chain names
67
69
no control the helper picks the smallest such element whose frame contains the point, searching
68
70
only the window the hit landed in (the app's front on-screen window when the hit names none). A
0 commit comments