( plugin: LoadedPlugin, managedNames: Set<string> | null, seedDirs: string[], )
| 108 | | 'deep-link' |
| 109 | |
| 110 | export 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 |
no test coverage detected