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

Function getBuiltinPlugins

src/plugins/builtinPlugins.ts:57–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 * Plugins whose isAvailable() returns false are omitted entirely.
56 */
57export function getBuiltinPlugins(): {
58 enabled: LoadedPlugin[]
59 disabled: LoadedPlugin[]
60} {
61 const settings = getSettings_DEPRECATED()
62 const enabled: LoadedPlugin[] = []
63 const disabled: LoadedPlugin[] = []
64
65 for (const [name, definition] of BUILTIN_PLUGINS) {
66 if (definition.isAvailable && !definition.isAvailable()) {
67 continue
68 }
69
70 const pluginId = `${name}@${BUILTIN_MARKETPLACE_NAME}`
71 const userSetting = settings?.enabledPlugins?.[pluginId]
72 // Enabled state: user preference > plugin default > true
73 const isEnabled =
74 userSetting !== undefined
75 ? userSetting === true
76 : (definition.defaultEnabled ?? true)
77
78 const plugin: LoadedPlugin = {
79 name,
80 manifest: {
81 name,
82 description: definition.description,
83 version: definition.version,
84 },
85 path: BUILTIN_MARKETPLACE_NAME, // sentinel — no filesystem path
86 source: pluginId,
87 repository: pluginId,
88 enabled: isEnabled,
89 isBuiltin: true,
90 hooksConfig: definition.hooks,
91 mcpServers: definition.mcpServers,
92 }
93
94 if (isEnabled) {
95 enabled.push(plugin)
96 } else {
97 disabled.push(plugin)
98 }
99 }
100
101 return { enabled, disabled }
102}
103
104/**
105 * Get skills from enabled built-in plugins as Command objects.

Callers 2

assemblePluginLoadResultFunction · 0.85

Calls 2

isAvailableMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected