(
plugin: string,
options: { scope?: string; cowork?: boolean; keepData?: boolean },
)
| 702 | |
| 703 | // plugin uninstall (lines 5738–5769) |
| 704 | export async function pluginUninstallHandler( |
| 705 | plugin: string, |
| 706 | options: { scope?: string; cowork?: boolean; keepData?: boolean }, |
| 707 | ): Promise<void> { |
| 708 | if (options.cowork) setUseCoworkPlugins(true) |
| 709 | const scope = options.scope || 'user' |
| 710 | if (options.cowork && scope !== 'user') { |
| 711 | cliError('--cowork can only be used with user scope') |
| 712 | } |
| 713 | if ( |
| 714 | !VALID_INSTALLABLE_SCOPES.includes( |
| 715 | scope as (typeof VALID_INSTALLABLE_SCOPES)[number], |
| 716 | ) |
| 717 | ) { |
| 718 | cliError( |
| 719 | `Invalid scope: ${scope}. Must be one of: ${VALID_INSTALLABLE_SCOPES.join(', ')}.`, |
| 720 | ) |
| 721 | } |
| 722 | const { name, marketplace } = parsePluginIdentifier(plugin) |
| 723 | logEvent('tengu_plugin_uninstall_command', { |
| 724 | _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 725 | ...(marketplace && { |
| 726 | _PROTO_marketplace_name: |
| 727 | marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 728 | }), |
| 729 | scope: scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 730 | }) |
| 731 | |
| 732 | await uninstallPlugin( |
| 733 | plugin, |
| 734 | scope as 'user' | 'project' | 'local', |
| 735 | options.keepData, |
| 736 | ) |
| 737 | } |
| 738 | |
| 739 | // plugin enable (lines 5783–5818) |
| 740 | export async function pluginEnableHandler( |
no test coverage detected