* Registers command handlers for this session. * * @param commands - An array of command definitions with handlers, or undefined to clear * @internal This method is typically called internally when creating/resuming a session.
(commands?: { name: string; handler: CommandHandler }[])
| 895 | * @internal This method is typically called internally when creating/resuming a session. |
| 896 | */ |
| 897 | registerCommands(commands?: { name: string; handler: CommandHandler }[]): void { |
| 898 | this.commandHandlers.clear(); |
| 899 | if (!commands) { |
| 900 | return; |
| 901 | } |
| 902 | for (const cmd of commands) { |
| 903 | this.commandHandlers.set(cmd.name, cmd.handler); |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | /** |
| 908 | * Registers the elicitation handler for this session. |
no test coverage detected