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

Function pluginInstallHandler

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

Source from the content-addressed store, hash-verified

662
663// plugin install (lines 5690–5721)
664export async function pluginInstallHandler(
665 plugin: string,
666 options: { scope?: string; cowork?: boolean },
667): Promise<void> {
668 if (options.cowork) setUseCoworkPlugins(true)
669 const scope = options.scope || 'user'
670 if (options.cowork && scope !== 'user') {
671 cliError('--cowork can only be used with user scope')
672 }
673 if (
674 !VALID_INSTALLABLE_SCOPES.includes(
675 scope as (typeof VALID_INSTALLABLE_SCOPES)[number],
676 )
677 ) {
678 cliError(
679 `Invalid scope: ${scope}. Must be one of: ${VALID_INSTALLABLE_SCOPES.join(', ')}.`,
680 )
681 }
682 // _PROTO_* routes to PII-tagged plugin_name/marketplace_name BQ columns.
683 // Unredacted plugin arg was previously logged to general-access
684 // additional_metadata for all users — dropped in favor of the privileged
685 // column route. marketplace may be undefined (fires before resolution).
686 const { name, marketplace } = parsePluginIdentifier(plugin)
687 logEvent('ncode_plugin_install_command', {
688 _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
689 ...(marketplace && {
690 _PROTO_marketplace_name:
691 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
692 }),
693 scope: scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
694 })
695
696 await installPlugin(plugin, scope as 'user' | 'project' | 'local')
697}
698
699// plugin uninstall (lines 5738–5769)
700export async function pluginUninstallHandler(

Callers 1

runFunction · 0.85

Calls 5

setUseCoworkPluginsFunction · 0.85
cliErrorFunction · 0.85
parsePluginIdentifierFunction · 0.85
installPluginFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected