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

Function removeInstalledPlugin

src/utils/plugins/installedPluginsManager.ts:934–962  ·  view source on GitHub ↗
(
  pluginId: string,
)

Source from the content-addressed store, hash-verified

932 * @returns The removed plugin metadata, or undefined if it wasn't installed
933 */
934export function removeInstalledPlugin(
935 pluginId: string,
936): InstalledPlugin | undefined {
937 const v2Data = loadInstalledPluginsFromDisk()
938 const installations = v2Data.plugins[pluginId]
939
940 if (!installations || installations.length === 0) {
941 return undefined
942 }
943
944 // Extract V1-compatible metadata from first installation for return value
945 const firstInstall = installations[0]
946 const metadata: InstalledPlugin | undefined = firstInstall
947 ? {
948 version: firstInstall.version || 'unknown',
949 installedAt: firstInstall.installedAt || new Date().toISOString(),
950 lastUpdated: firstInstall.lastUpdated,
951 installPath: firstInstall.installPath,
952 gitCommitSha: firstInstall.gitCommitSha,
953 }
954 : undefined
955
956 delete v2Data.plugins[pluginId]
957 saveInstalledPluginsV2(v2Data)
958
959 logForDebugging(`Removed installed plugin: ${pluginId}`)
960
961 return metadata
962}
963
964/**
965 * Delete a plugin's cache directory

Callers

nothing calls this directly

Calls 3

saveInstalledPluginsV2Function · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected