( metadata: CommandMetadata<Name, Input>, run: (client: AgentDeviceClient, input: Input) => Promise<Result>, )
| 44 | } |
| 45 | |
| 46 | export function defineExecutableCommand<Name extends string, Input, Result>( |
| 47 | metadata: CommandMetadata<Name, Input>, |
| 48 | run: (client: AgentDeviceClient, input: Input) => Promise<Result>, |
| 49 | ): ExecutableCommandContract<Name, Input, Result> { |
| 50 | return { |
| 51 | ...metadata, |
| 52 | run, |
| 53 | invoke: async (client, input) => await run(client, metadata.readInput(input)), |
| 54 | }; |
| 55 | } |
no test coverage detected