(
pluginId: string,
commandName: string,
args?: string | undefined,
)
| 490 | } |
| 491 | |
| 492 | async activatePluginCommand( |
| 493 | pluginId: string, |
| 494 | commandName: string, |
| 495 | args?: string | undefined, |
| 496 | ): Promise<void> { |
| 497 | this.ensureOpen(); |
| 498 | const normalizedPluginId = pluginId.trim(); |
| 499 | const normalizedCommandName = commandName.trim(); |
| 500 | if (normalizedPluginId.length === 0 || normalizedCommandName.length === 0) { |
| 501 | throw new KimiError( |
| 502 | ErrorCodes.REQUEST_INVALID, |
| 503 | 'Plugin id and command name cannot be empty', |
| 504 | ); |
| 505 | } |
| 506 | const commandArgs = normalizeOptionalString(args); |
| 507 | await this.rpc.activatePluginCommand({ |
| 508 | sessionId: this.id, |
| 509 | pluginId: normalizedPluginId, |
| 510 | commandName: normalizedCommandName, |
| 511 | ...(commandArgs !== undefined ? { args: commandArgs } : {}), |
| 512 | }); |
| 513 | } |
| 514 | |
| 515 | async close(): Promise<void> { |
| 516 | if (this.closed) return; |
nothing calls this directly
no test coverage detected