11import type {
2- AgentDeviceClient ,
32 AppCloseOptions ,
43 ClipboardCommandOptions ,
54 MetroPrepareOptions ,
@@ -11,27 +10,23 @@ import type {
1110 WaitCommandOptions ,
1211} from '../client-types.ts' ;
1312import type { DaemonInstallSource } from '../contracts.ts' ;
14- import { defineCommand } from './command-contract.ts' ;
1513import {
1614 booleanSchema ,
1715 booleanField ,
1816 enumField ,
19- fieldsInputSchema ,
2017 integerField ,
2118 integerSchema ,
2219 jsonSchemaField ,
2320 looseObjectField ,
2421 looseObjectSchema ,
2522 numberField ,
2623 optionalEnum ,
27- readFieldInput ,
2824 requiredField ,
2925 stringArrayField ,
3026 stringField ,
3127 stringSchema ,
32- type InferCommandInput ,
33- type CommandFieldMap ,
3428} from './command-input.ts' ;
29+ import { defineFieldCommand } from './field-command-contract.ts' ;
3530
3631const SURFACE_VALUES = [ 'app' , 'frontmost-app' , 'desktop' , 'menubar' ] as const ;
3732const WAIT_KIND_VALUES = [ 'duration' , 'text' , 'ref' , 'selector' ] as const ;
@@ -363,25 +358,6 @@ export const clientCommandDefinitions = [
363358 ) ,
364359] as const ;
365360
366- function defineFieldCommand <
367- const TName extends string ,
368- const TFields extends CommandFieldMap ,
369- TResult ,
370- > (
371- name : TName ,
372- description : string ,
373- fields : TFields ,
374- run : ( client : AgentDeviceClient , input : InferCommandInput < TFields > ) => Promise < TResult > ,
375- ) {
376- return defineCommand ( {
377- name,
378- description,
379- inputSchema : fieldsInputSchema ( fields ) ,
380- readInput : ( input ) => readFieldInput ( input , fields ) ,
381- run,
382- } ) ;
383- }
384-
385361function withoutApp ( input : AppCloseOptions & { shutdown ?: boolean } ) : { shutdown ?: boolean } {
386362 const { app : _app , ...rest } = input ;
387363 return rest ;
0 commit comments