@@ -6,7 +6,12 @@ import {
66 shouldUseHostMacFastPath ,
77 type DeviceInventoryRequest ,
88} from '../../contracts/device-inventory.ts' ;
9- import { isMacOs , isTvOsDevice , type DeviceInfo } from '../../kernel/device.ts' ;
9+ import {
10+ isMacOs ,
11+ isTvOsDevice ,
12+ resolveDeviceAppleOs ,
13+ type DeviceInfo ,
14+ } from '../../kernel/device.ts' ;
1015import type { RunnerContext } from '../../core/interactor-types.ts' ;
1116
1217// ---------------------------------------------------------------------------
@@ -44,7 +49,7 @@ const supportsOrientation = (device: DeviceInfo): boolean => {
4449 return caps ? caps . orientation : device . platform === 'android' ;
4550} ;
4651
47- // The Apple arm shared by `clipboard`/`alert`/` settings` (was `macos || simulator`):
52+ // The Apple arm shared by `clipboard`/`settings` (was `macos || simulator`):
4853// reachable on the macOS host directly, on every other Apple OS only on the simulator.
4954// Off Apple this preserves the trailing `device.kind === 'simulator'` term verbatim.
5055const supportsHostOrSimulatorSurface = ( device : DeviceInfo ) : boolean => {
@@ -54,6 +59,12 @@ const supportsHostOrSimulatorSurface = (device: DeviceInfo): boolean => {
5459 : device . kind === 'simulator' ;
5560} ;
5661
62+ // Alerts use the host/simulator surface plus physical iOS, whose XCTest path is
63+ // device-verified. iPadOS/visionOS remain closed until independently verified.
64+ const supportsAlertSurface = ( device : DeviceInfo ) : boolean =>
65+ device . platform === 'android' ||
66+ ( device . platform === 'apple' && resolveDeviceAppleOs ( device ) === 'ios' ) ||
67+ supportsHostOrSimulatorSurface ( device ) ;
5768// `tv-remote` is Android-TV or tvOS only. Off Apple this preserves the Android-TV
5869// branch so the relocated Apple closure stays equivalent to the full original
5970// supports predicate under the parity guard; the closure is only consulted for Apple
@@ -80,8 +91,7 @@ const APPLE_SUPPORTS_BY_DEFAULT: Record<string, (device: DeviceInfo) => boolean>
8091 [ PUBLIC_COMMANDS . keyboard ] : supportsKeyboard ,
8192 [ PUBLIC_COMMANDS . rotate ] : supportsOrientation ,
8293 [ PUBLIC_COMMANDS . tvRemote ] : supportsTvRemote ,
83- [ PUBLIC_COMMANDS . alert ] : ( device ) =>
84- device . platform === 'android' || supportsHostOrSimulatorSurface ( device ) ,
94+ [ PUBLIC_COMMANDS . alert ] : supportsAlertSurface ,
8595 [ PUBLIC_COMMANDS . settings ] : ( device ) =>
8696 device . platform === 'android' || supportsHostOrSimulatorSurface ( device ) ,
8797 [ PUBLIC_COMMANDS . audio ] : isAudioProbeSupportedDevice ,
0 commit comments