( host: SlashCommandHost, label: string, official: boolean, )
| 273 | } |
| 274 | |
| 275 | async function confirmInstallTrust( |
| 276 | host: SlashCommandHost, |
| 277 | label: string, |
| 278 | official: boolean, |
| 279 | ): Promise<boolean> { |
| 280 | // Kimi-built official plugins are trusted implicitly; anything else requires |
| 281 | // the user to explicitly opt in via the trust prompt. |
| 282 | if (official) return true; |
| 283 | return new Promise((resolveConfirmed) => { |
| 284 | host.mountEditorReplacement( |
| 285 | new PluginInstallTrustConfirmComponent({ |
| 286 | label, |
| 287 | onDone: (result: PluginInstallTrustConfirmResult) => { |
| 288 | host.restoreEditor(); |
| 289 | resolveConfirmed(result.kind === 'confirm'); |
| 290 | }, |
| 291 | }), |
| 292 | ); |
| 293 | }); |
| 294 | } |
| 295 | |
| 296 | async function installFromPanel( |
| 297 | host: SlashCommandHost, |
no test coverage detected