@@ -38,10 +38,9 @@ function getGlobalDir() {
3838 * 2. Local: {targetDir}/node_modules/
3939 *
4040 * @param {string } targetDir - The .opencode directory (e.g., /project/.opencode)
41- * @param {string } [monorepoDir] - Optional: Direct path to a monorepo (for development)
4241 * @returns {Map<string, PluginDescriptor> } Map of plugin name to descriptor
4342 */
44- export function discoverPlugins ( targetDir , monorepoDir = null ) {
43+ export function discoverPlugins ( targetDir ) {
4544 const globalDir = getGlobalDir ( ) ;
4645
4746 // Scan all locations (order matters: last wins)
@@ -64,28 +63,6 @@ export function discoverPlugins(targetDir, monorepoDir = null) {
6463 allPlugins . set ( name , descriptor ) ;
6564 }
6665
67- // Optional: Direct monorepo path (for when running from installed package or cloned repo)
68- if ( monorepoDir && fs . existsSync ( monorepoDir ) ) {
69- // Determine the correct location based on where the monorepo is installed
70- const localNodeModules = path . join ( targetDir , 'node_modules' ) ;
71-
72- let monorepoLocation = 'local' ; // default
73- if ( globalDir && monorepoDir . startsWith ( globalDir ) ) {
74- monorepoLocation = 'global' ;
75- } else if ( monorepoDir . startsWith ( localNodeModules ) ) {
76- monorepoLocation = 'local' ;
77- }
78- // If none match, it's likely a development clone - keep as 'local' (highest priority)
79-
80- const monorepoPlugins = scanMonorepoSubdirs ( monorepoDir , monorepoLocation ) ;
81- for ( const [ name , descriptor ] of monorepoPlugins . entries ( ) ) {
82- if ( allPlugins . has ( name ) ) {
83- console . log ( ` ⚠️ Plugin "${ name } " found in ${ monorepoLocation } monorepo, overrides previous` ) ;
84- }
85- allPlugins . set ( name , descriptor ) ;
86- }
87- }
88-
8966 return allPlugins ;
9067}
9168
0 commit comments