MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / pluginUpdateHandler

Function pluginUpdateHandler

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

Source from the content-addressed store, hash-verified

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