({ id }: GetPluginInfoPayload)
| 889 | } |
| 890 | |
| 891 | async getPluginInfo({ id }: GetPluginInfoPayload): Promise<PluginInfo> { |
| 892 | await this.pluginsReady; |
| 893 | this.assertPluginsLoaded(); |
| 894 | const info = this.plugins.info(id); |
| 895 | if (info === undefined) { |
| 896 | throw new KimiError( |
| 897 | ErrorCodes.PLUGIN_NOT_FOUND, |
| 898 | `Plugin "${id}" is not installed`, |
| 899 | { details: { id } }, |
| 900 | ); |
| 901 | } |
| 902 | return info; |
| 903 | } |
| 904 | |
| 905 | private assertPluginsLoaded(): void { |
| 906 | if (this.pluginsLoadError === undefined) return; |
no test coverage detected