import { Platform } from 'react-native'; import { HOST_BRIDGE_VERSION, type HostBridgeRequest, type HostBridgeRuntimeResult, } from '../../../../packages/shared/src/contracts/hostBridge'; import { MOBILE_SHELL_HOST_VERSION } from '../shell/runtime'; import { resolveMobileHostCapabilities } from './capabilities'; import { ok } from './protocol'; export function getMobileRuntimePlatform() { return Platform.OS === 'ios' ? 'ios' : 'android'; } export function getMobileHostBridgeRuntime(): HostBridgeRuntimeResult { const platform = getMobileRuntimePlatform(); return { shell: 'expo_mobile', platform, hostVersion: MOBILE_SHELL_HOST_VERSION, bridgeVersion: HOST_BRIDGE_VERSION, capabilities: resolveMobileHostCapabilities(platform), }; } export function getMobileHostBridgeRuntimeResponse(request: HostBridgeRequest) { return ok(request, getMobileHostBridgeRuntime()); }