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

Function installPlugin

src/services/plugins/pluginCliCommands.ts:103–145  ·  view source on GitHub ↗
(
  plugin: string,
  scope: InstallableScope = 'user',
)

Source from the content-addressed store, hash-verified

101 * @param scope Installation scope: user, project, or local (defaults to 'user')
102 */
103export async function installPlugin(
104 plugin: string,
105 scope: InstallableScope = 'user',
106): Promise<void> {
107 try {
108 // biome-ignore lint/suspicious/noConsole:: intentional console output
109 console.log(`Installing plugin "${plugin}"...`)
110
111 const result = await installPluginOp(plugin, scope)
112
113 if (!result.success) {
114 throw new Error(result.message)
115 }
116
117 // biome-ignore lint/suspicious/noConsole:: intentional console output
118 console.log(`${figures.tick} ${result.message}`)
119
120 // _PROTO_* routes to PII-tagged plugin_name/marketplace_name BQ columns.
121 // Unredacted plugin_id was previously logged to general-access
122 // additional_metadata for all users — dropped in favor of the privileged
123 // column route.
124 const { name, marketplace } = parsePluginIdentifier(
125 result.pluginId || plugin,
126 )
127 logEvent('ncode_plugin_installed_cli', {
128 _PROTO_plugin_name:
129 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
130 ...(marketplace && {
131 _PROTO_marketplace_name:
132 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
133 }),
134 scope: (result.scope ||
135 scope) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
136 install_source:
137 'cli-explicit' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
138 ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()),
139 })
140
141 cliOk()
142 } catch (error) {
143 handlePluginCommandError(error, 'install', plugin)
144 }
145}
146
147/**
148 * CLI command: Uninstall a plugin non-interactively

Callers 1

pluginInstallHandlerFunction · 0.85

Calls 7

installPluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
getManagedPluginNamesFunction · 0.85
cliOkFunction · 0.85
handlePluginCommandErrorFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected