MCPcopy
hub / github.com/codeaashu/claude-code / getEnabledVia

Function getEnabledVia

src/utils/telemetry/pluginTelemetry.ts:110–126  ·  view source on GitHub ↗
(
  plugin: LoadedPlugin,
  managedNames: Set<string> | null,
  seedDirs: string[],
)

Source from the content-addressed store, hash-verified

108 | 'deep-link'
109
110export function getEnabledVia(
111 plugin: LoadedPlugin,
112 managedNames: Set<string> | null,
113 seedDirs: string[],
114): EnabledVia {
115 if (plugin.isBuiltin) return 'default-enable'
116 if (managedNames?.has(plugin.name)) return 'org-policy'
117 // Trailing sep: /opt/plugins must not match /opt/plugins-extra
118 if (
119 seedDirs.some(dir =>
120 plugin.path.startsWith(dir.endsWith(sep) ? dir : dir + sep),
121 )
122 ) {
123 return 'seed-mount'
124 }
125 return 'user-install'
126}
127
128/**
129 * Common plugin telemetry fields keyed off name@marketplace. Returns the

Callers 1

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected