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

Function alertCommand

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

Source from the content-addressed store, hash-verified

283 SystemAlertCommandOptions | undefined,
284 SystemAlertCommandResult
285> = async (runtime, options = {}): Promise<SystemAlertCommandResult> => {
286 if (!runtime.backend.handleAlert) {
287 throw new AppError('UNSUPPORTED_OPERATION', 'system.alert is not supported by this backend');
288 }
289 const action = options.action ?? 'get';
290 if (action !== 'get' && action !== 'accept' && action !== 'dismiss' && action !== 'wait') {
291 throw new AppError('INVALID_ARGS', 'system.alert action must be get, accept, dismiss, or wait');
292 }
293 const timeoutMs =
294 options.timeoutMs === undefined
295 ? undefined
296 : requireIntInRange(options.timeoutMs, 'timeoutMs', 0, 120_000);
297 const result = await runtime.backend.handleAlert(toBackendContext(runtime, options), action, {
298 timeoutMs,
299 });
300 return normalizeAlertResult(action, result);
301};
302
303export const appSwitcherCommand: RuntimeCommand<
304 SystemAppSwitcherCommandOptions | undefined,

Callers

nothing calls this directly

Calls 3

requireIntInRangeFunction · 0.90
toBackendContextFunction · 0.90
normalizeAlertResultFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…