MCPcopy Create free account
hub / github.com/Noumena-Network/code / pluginUninstallHandler

Function pluginUninstallHandler

src/cli/handlers/plugins.ts:700–733  ·  view source on GitHub ↗
(
  plugin: string,
  options: { scope?: string; cowork?: boolean; keepData?: boolean },
)

Source from the content-addressed store, hash-verified

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

Callers 1

runFunction · 0.85

Calls 5

setUseCoworkPluginsFunction · 0.85
cliErrorFunction · 0.85
parsePluginIdentifierFunction · 0.85
uninstallPluginFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected