(runtime, options = {})
| 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 | |
| 303 | export const appSwitcherCommand: RuntimeCommand< |
| 304 | SystemAppSwitcherCommandOptions | undefined, |
nothing calls this directly
no test coverage detected
searching dependent graphs…