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

Function shutdownCommand

src/commands/management/runtime/admin.ts:111–127  ·  view source on GitHub ↗
(runtime, options = {})

Source from the content-addressed store, hash-verified

109 AdminShutdownCommandOptions | undefined,
110 AdminShutdownCommandResult
111> = async (runtime, options = {}): Promise<AdminShutdownCommandResult> => {
112 if (!runtime.backend.shutdownDevice) {
113 throw new AppError('UNSUPPORTED_OPERATION', 'admin.shutdown is not supported by this backend');
114 }
115 const target = normalizeDeviceTarget(options.target);
116 const backendResult = await runtime.backend.shutdownDevice(
117 toBackendContext(runtime, options),
118 target,
119 );
120 const formattedBackendResult = toBackendResult(backendResult);
121 return {
122 kind: 'deviceShutdown',
123 ...(target ? { target } : {}),
124 ...(formattedBackendResult ? { backendResult: formattedBackendResult } : {}),
125 ...successText('Shutdown device'),
126 };
127};
128
129export const installCommand: RuntimeCommand<
130 AdminInstallCommandOptions,

Callers

nothing calls this directly

Calls 4

toBackendContextFunction · 0.90
toBackendResultFunction · 0.90
successTextFunction · 0.90
normalizeDeviceTargetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…