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

Function disableAllPluginsOp

src/services/plugins/pluginOperations.ts:785–815  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

783 * @returns Result indicating success/failure with count of disabled plugins
784 */
785export async function disableAllPluginsOp(): Promise<PluginOperationResult> {
786 const enabledPlugins = getPluginEditableScopes()
787
788 if (enabledPlugins.size === 0) {
789 return { success: true, message: 'No enabled plugins to disable' }
790 }
791
792 const disabled: string[] = []
793 const errors: string[] = []
794
795 for (const [pluginId] of enabledPlugins) {
796 const result = await setPluginEnabledOp(pluginId, false)
797 if (result.success) {
798 disabled.push(pluginId)
799 } else {
800 errors.push(`${pluginId}: ${result.message}`)
801 }
802 }
803
804 if (errors.length > 0) {
805 return {
806 success: false,
807 message: `Disabled ${disabled.length} ${plural(disabled.length, 'plugin')}, ${errors.length} failed:\n${errors.join('\n')}`,
808 }
809 }
810
811 return {
812 success: true,
813 message: `Disabled ${disabled.length} ${plural(disabled.length, 'plugin')}`,
814 }
815}
816
817/**
818 * Update a plugin to the latest version.

Callers 1

disableAllPluginsFunction · 0.85

Calls 3

getPluginEditableScopesFunction · 0.85
setPluginEnabledOpFunction · 0.85
pluralFunction · 0.85

Tested by

no test coverage detected