MCPcopy Create free account
hub / github.com/callstack/agent-device / openAppCommand

Function openAppCommand

src/commands/management/runtime/apps.ts:95–121  ·  view source on GitHub ↗
(
  runtime,
  options,
)

Source from the content-addressed store, hash-verified

93} & BackendResultEnvelope;
94
95export 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
123export const closeAppCommand: RuntimeCommand<
124 CloseAppCommandOptions | undefined,

Callers

nothing calls this directly

Calls 5

toBackendResultFunction · 0.90
successTextFunction · 0.90
normalizeOpenTargetFunction · 0.85
toAppBackendContextFunction · 0.85
formatOpenTargetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…