MCPcopy
hub / github.com/codeaashu/claude-code / pluginUpdateHandler

Function pluginUpdateHandler

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

Source from the content-addressed store, hash-verified

844
845// plugin update (lines 5918–5948)
846export async function pluginUpdateHandler(
847 plugin: string,
848 options: { scope?: string; cowork?: boolean },
849): Promise<void> {
850 if (options.cowork) setUseCoworkPlugins(true)
851 const { name, marketplace } = parsePluginIdentifier(plugin)
852 logEvent('tengu_plugin_update_command', {
853 _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
854 ...(marketplace && {
855 _PROTO_marketplace_name:
856 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
857 }),
858 })
859
860 let scope: (typeof VALID_UPDATE_SCOPES)[number] = 'user'
861 if (options.scope) {
862 if (
863 !VALID_UPDATE_SCOPES.includes(
864 options.scope as (typeof VALID_UPDATE_SCOPES)[number],
865 )
866 ) {
867 cliError(
868 `Invalid scope "${options.scope}". Valid scopes: ${VALID_UPDATE_SCOPES.join(', ')}`,
869 )
870 }
871 scope = options.scope as (typeof VALID_UPDATE_SCOPES)[number]
872 }
873 if (options.cowork && scope !== 'user') {
874 cliError('--cowork can only be used with user scope')
875 }
876
877 await updatePluginCli(plugin, scope)
878}
879
880

Callers 1

runFunction · 0.85

Calls 5

setUseCoworkPluginsFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
cliErrorFunction · 0.85
updatePluginCliFunction · 0.85

Tested by

no test coverage detected