88 SCREENSHOT_SPECIFIC_FLAG_DEFINITIONS ,
99 type ScreenshotRequestFlags ,
1010} from '../commands/capture-screenshot-options.ts' ;
11+ import type { CliCommandName } from '../command-catalog.ts' ;
1112
1213export type CliFlags = RemoteConfigMetroOptions &
1314 ScreenshotRequestFlags & {
@@ -1481,7 +1482,7 @@ export const GLOBAL_FLAG_KEYS = new Set<FlagKey>([
14811482 'noRecord' ,
14821483] ) ;
14831484
1484- const COMMAND_SCHEMAS : Record < string , CommandSchema > = {
1485+ const COMMAND_SCHEMAS : Record < CliCommandName , CommandSchema > = {
14851486 boot : {
14861487 helpDescription : 'Ensure target device/simulator is booted and ready' ,
14871488 summary : 'Boot target device/simulator' ,
@@ -1944,6 +1945,8 @@ const COMMAND_SCHEMAS: Record<string, CommandSchema> = {
19441945 } ,
19451946} ;
19461947
1948+ const COMMAND_SCHEMA_MAP : Readonly < Record < string , CommandSchema > > = COMMAND_SCHEMAS ;
1949+
19471950const flagDefinitionByName = new Map < string , FlagDefinition > ( ) ;
19481951const flagDefinitionsByKey = new Map < FlagKey , FlagDefinition [ ] > ( ) ;
19491952for ( const definition of FLAG_DEFINITIONS ) {
@@ -1965,7 +1968,7 @@ export function getFlagDefinitions(): readonly FlagDefinition[] {
19651968
19661969export function getCommandSchema ( command : string | null ) : CommandSchema | undefined {
19671970 if ( ! command ) return undefined ;
1968- return COMMAND_SCHEMAS [ command ] ;
1971+ return COMMAND_SCHEMA_MAP [ command ] ;
19691972}
19701973
19711974export function applyCommandDefaults (
@@ -2044,7 +2047,7 @@ CLI to control iOS and Android devices for AI agents.
20442047` ;
20452048
20462049 const commands = getCliCommandNames ( ) . map ( ( name ) => {
2047- const schema = COMMAND_SCHEMAS [ name ] ;
2050+ const schema = COMMAND_SCHEMA_MAP [ name ] ;
20482051 if ( ! schema ) throw new Error ( `Missing command schema for ${ name } ` ) ;
20492052 return { name, schema, usage : buildCommandListUsage ( name , schema ) } ;
20502053 } ) ;
0 commit comments