MCPcopy Index your code
hub / github.com/codeaashu/claude-code / checkEnabledPlugins

Function checkEnabledPlugins

src/utils/plugins/pluginStartupCheck.ts:39–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 * @returns Array of plugin IDs (plugin@marketplace format) that are enabled
38 */
39export async function checkEnabledPlugins(): Promise<string[]> {
40 const settings = getInitialSettings()
41 const enabledPlugins: string[] = []
42
43 // Start with --add-dir plugins (lowest priority)
44 const addDirPlugins = getAddDirEnabledPlugins()
45 for (const [pluginId, value] of Object.entries(addDirPlugins)) {
46 if (pluginId.includes('@') && value) {
47 enabledPlugins.push(pluginId)
48 }
49 }
50
51 // Merged settings (policy > local > project > user) override --add-dir
52 if (settings.enabledPlugins) {
53 for (const [pluginId, value] of Object.entries(settings.enabledPlugins)) {
54 if (!pluginId.includes('@')) {
55 continue
56 }
57 const idx = enabledPlugins.indexOf(pluginId)
58 if (value) {
59 if (idx === -1) {
60 enabledPlugins.push(pluginId)
61 }
62 } else {
63 // Explicitly disabled — remove even if --add-dir enabled it
64 if (idx !== -1) {
65 enabledPlugins.splice(idx, 1)
66 }
67 }
68 }
69 }
70
71 return enabledPlugins
72}
73
74/**
75 * Gets the user-editable scope that "owns" each enabled plugin.

Callers

nothing calls this directly

Calls 5

getInitialSettingsFunction · 0.85
getAddDirEnabledPluginsFunction · 0.85
entriesMethod · 0.80
spliceMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected