(params: {
command: string;
positionals: string[];
flags: CliFlags;
client: AgentDeviceClient;
debug?: boolean;
replayTestReporterRuntime?: ClientCommandParams['replayTestReporterRuntime'];
})
| 29 | } satisfies ClientCommandHandlerMap; |
| 30 | |
| 31 | export 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 | |
| 52 | async function runGenericClientBackedCommand( |
| 53 | params: { |
no test coverage detected