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

Function tryRunClientBackedCommand

src/cli/commands/router.ts:31–50  ·  view source on GitHub ↗
(params: {
  command: string;
  positionals: string[];
  flags: CliFlags;
  client: AgentDeviceClient;
  debug?: boolean;
  replayTestReporterRuntime?: ClientCommandParams['replayTestReporterRuntime'];
})

Source from the content-addressed store, hash-verified

29} satisfies ClientCommandHandlerMap;
30
31export async function tryRunClientBackedCommand(params: {
32 command: string;
33 positionals: string[];
34 flags: CliFlags;
35 client: AgentDeviceClient;
36 debug?: boolean;
37 replayTestReporterRuntime?: ClientCommandParams['replayTestReporterRuntime'];
38}): Promise<boolean> {
39 const flags = { ...params.flags };
40 const dedicatedHandler =
41 dedicatedCliCommandHandlers[params.command as keyof typeof dedicatedCliCommandHandlers];
42 if (dedicatedHandler) {
43 const handled = await dedicatedHandler({ ...params, flags });
44 if (handled) return true;
45 }
46 if (isClientBackedCliCommandName(params.command)) {
47 return await runGenericClientBackedCommand({ ...params, command: params.command, flags });
48 }
49 return false;
50}
51
52async function runGenericClientBackedCommand(
53 params: {

Callers 2

runCliFunction · 0.90

Calls 2

Tested by

no test coverage detected