MCPcopy Index your code
hub / github.com/callstack/agent-device / backCommand

Function backCommand

src/commands/system/runtime/system.ts:133–151  ·  view source on GitHub ↗
(runtime, options = {})

Source from the content-addressed store, hash-verified

131 SystemBackCommandOptions | undefined,
132 SystemBackCommandResult
133> = async (runtime, options = {}): Promise<SystemBackCommandResult> => {
134 if (!runtime.backend.pressBack) {
135 throw new AppError('UNSUPPORTED_OPERATION', 'system.back is not supported by this backend');
136 }
137 const mode = options.mode ?? 'in-app';
138 if (mode !== 'in-app' && mode !== 'system') {
139 throw new AppError('INVALID_ARGS', 'system.back mode must be in-app or system');
140 }
141 const backendResult = await runtime.backend.pressBack(toBackendContext(runtime, options), {
142 mode,
143 });
144 const formattedBackendResult = toBackendResult(backendResult);
145 return {
146 kind: 'systemBack',
147 mode,
148 ...(formattedBackendResult ? { backendResult: formattedBackendResult } : {}),
149 ...successText('Back'),
150 };
151};
152
153export const homeCommand: RuntimeCommand<
154 SystemHomeCommandOptions | undefined,

Callers

nothing calls this directly

Calls 3

toBackendContextFunction · 0.90
toBackendResultFunction · 0.90
successTextFunction · 0.90

Tested by

no test coverage detected