( runtime, options, )
| 93 | } & BackendResultEnvelope; |
| 94 | |
| 95 | export const openAppCommand: RuntimeCommand<OpenAppCommandOptions, OpenAppCommandResult> = async ( |
| 96 | runtime, |
| 97 | options, |
| 98 | ): Promise<OpenAppCommandResult> => { |
| 99 | if (!runtime.backend.openApp) { |
| 100 | throw new AppError('UNSUPPORTED_OPERATION', 'apps.open is not supported by this backend'); |
| 101 | } |
| 102 | |
| 103 | const target = normalizeOpenTarget(options); |
| 104 | const backendResult = await runtime.backend.openApp( |
| 105 | toAppBackendContext(runtime, options), |
| 106 | target, |
| 107 | { |
| 108 | launchArgs: options.launchArgs, |
| 109 | relaunch: options.relaunch, |
| 110 | }, |
| 111 | ); |
| 112 | |
| 113 | const formattedBackendResult = toBackendResult(backendResult); |
| 114 | return { |
| 115 | kind: 'appOpened', |
| 116 | target, |
| 117 | relaunch: options.relaunch === true, |
| 118 | ...(formattedBackendResult ? { backendResult: formattedBackendResult } : {}), |
| 119 | ...successText(`Opened: ${formatOpenTarget(target)}`), |
| 120 | }; |
| 121 | }; |
| 122 | |
| 123 | export const closeAppCommand: RuntimeCommand< |
| 124 | CloseAppCommandOptions | undefined, |
nothing calls this directly
no test coverage detected
searching dependent graphs…