( device: DeviceInfo, runnerContext: RunnerContext, )
| 10 | registerBuiltinPlatformPlugins(); |
| 11 | |
| 12 | export async function getInteractor( |
| 13 | device: DeviceInfo, |
| 14 | runnerContext: RunnerContext, |
| 15 | ): Promise<Interactor> { |
| 16 | if (isActiveProviderDevice(device)) { |
| 17 | const providerInteractor = getProviderDeviceInteractor(device); |
| 18 | if (providerInteractor) return providerInteractor; |
| 19 | throw new AppError( |
| 20 | 'UNSUPPORTED_OPERATION', |
| 21 | 'Provider device runtime does not have an active interactor for this device.', |
| 22 | { deviceId: device.id, platform: publicPlatformString(device) }, |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | // Byte-identical replacement for the former per-platform switch: each plugin's |
| 27 | // `createInteractor` is the SAME lazy dynamic import + factory call the switch |
| 28 | // arm performed, and `getPlugin` throws the SAME `UNSUPPORTED_PLATFORM` AppError |
| 29 | // the switch default threw. Registry exhaustiveness (BuiltinPluginsCoverAllPlatforms) |
| 30 | // guarantees every leaf `Platform` resolves. |
| 31 | return await getPlugin(device.platform).createInteractor(device, runnerContext); |
| 32 | } |
no test coverage detected