(
plugin: string,
options: { scope?: string; cowork?: boolean; keepData?: boolean },
)
| 664 | |
| 665 | // plugin uninstall (lines 5738–5769) |
| 666 | export async function pluginUninstallHandler( |
| 667 | plugin: string, |
| 668 | options: { scope?: string; cowork?: boolean; keepData?: boolean }, |
| 669 | ): Promise<void> { |
| 670 | if (options.cowork) setUseCoworkPlugins(true) |
| 671 | const scope = options.scope || 'user' |
| 672 | if (options.cowork && scope !== 'user') { |
| 673 | cliError('--cowork can only be used with user scope') |
| 674 | } |
| 675 | if ( |
| 676 | !VALID_INSTALLABLE_SCOPES.includes( |
| 677 | scope as (typeof VALID_INSTALLABLE_SCOPES)[number], |
| 678 | ) |
| 679 | ) { |
| 680 | cliError( |
| 681 | `Invalid scope: ${scope}. Must be one of: ${VALID_INSTALLABLE_SCOPES.join(', ')}.`, |
| 682 | ) |
| 683 | } |
| 684 | const { name, marketplace } = parsePluginIdentifier(plugin) |
| 685 | logEvent('tengu_plugin_uninstall_command', { |
| 686 | _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 687 | ...(marketplace && { |
| 688 | _PROTO_marketplace_name: |
| 689 | marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 690 | }), |
| 691 | scope: scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 692 | }) |
| 693 | |
| 694 | await uninstallPlugin( |
| 695 | plugin, |
| 696 | scope as 'user' | 'project' | 'local', |
| 697 | options.keepData, |
| 698 | ) |
| 699 | } |
| 700 | |
| 701 | // plugin enable (lines 5783–5818) |
| 702 | export async function pluginEnableHandler( |
no test coverage detected