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

Function disablePlugin

src/services/plugins/pluginCliCommands.ts:233–266  ·  view source on GitHub ↗
(
  plugin: string,
  scope?: InstallableScope,
)

Source from the content-addressed store, hash-verified

231 * @param scope Optional scope. If not provided, finds the most specific scope for the current project.
232 */
233export async function disablePlugin(
234 plugin: string,
235 scope?: InstallableScope,
236): Promise<void> {
237 try {
238 const result = await disablePluginOp(plugin, scope)
239
240 if (!result.success) {
241 throw new Error(result.message)
242 }
243
244 // biome-ignore lint/suspicious/noConsole:: intentional console output
245 console.log(`${figures.tick} ${result.message}`)
246
247 const { name, marketplace } = parsePluginIdentifier(
248 result.pluginId || plugin,
249 )
250 logEvent('ncode_plugin_disabled_cli', {
251 _PROTO_plugin_name:
252 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
253 ...(marketplace && {
254 _PROTO_marketplace_name:
255 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
256 }),
257 scope:
258 result.scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
259 ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()),
260 })
261
262 cliOk()
263 } catch (error) {
264 handlePluginCommandError(error, 'disable', plugin)
265 }
266}
267
268/**
269 * CLI command: Disable all enabled plugins non-interactively

Callers 1

pluginDisableHandlerFunction · 0.85

Calls 7

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

Tested by

no test coverage detected