MCPcopy
hub / github.com/callstack/agent-device / requireCommandSupported

Function requireCommandSupported

src/daemon/handlers/response.ts:34–49  ·  view source on GitHub ↗
(
  command: string,
  device: DeviceInfo,
  options?: { message?: string; hint?: boolean },
)

Source from the content-addressed store, hash-verified

32 * device-specific unsupported hint (as generic command dispatch does).
33 */
34export function requireCommandSupported(
35 command: string,
36 device: DeviceInfo,
37 options?: { message?: string; hint?: boolean },
38): DaemonFailureResponse | null {
39 if (isCommandSupportedOnDevice(command, device)) return null;
40 const hint = options?.hint ? unsupportedHintForDevice(command, device) : undefined;
41 return {
42 ok: false,
43 error: {
44 code: 'UNSUPPORTED_OPERATION',
45 message: options?.message ?? `${command} is not supported on this device`,
46 ...(hint ? { hint } : {}),
47 },
48 };
49}

Callers 15

dispatchWaitViaRuntimeFunction · 0.90
createSelectorRuntimeFunction · 0.90
handleSettingsCommandFunction · 0.90
handleAppDeployCommandFunction · 0.90
dispatchFillViaRuntimeFunction · 0.90
dispatchTypeViaRuntimeFunction · 0.90
handleLogsCommandFunction · 0.90

Calls 2

unsupportedHintForDeviceFunction · 0.90

Tested by

no test coverage detected