export type GatewayLaunchStrategy = 'utility-process' | 'node-runtime'; function normalizeForcedStrategy( forced: string | undefined, ): GatewayLaunchStrategy | null { const normalized = forced?.trim().toLowerCase(); switch (normalized) { case 'utility': case 'utility-process': return 'utility-process'; case 'node-runtime': case 'node': case 'cli': case 'electron-run-as-node': return 'node-runtime'; default: return null; } } export function resolveGatewayLaunchStrategy(options: { platform: NodeJS.Platform; mode: 'dev' | 'packaged'; forced?: string | undefined; }): GatewayLaunchStrategy { const forced = normalizeForcedStrategy(options.forced); if (forced) { return forced; } if (options.platform === 'win32' && options.mode === 'dev') { return 'node-runtime'; } return 'utility-process'; }