77use Illuminate \Support \Collection ;
88use Illuminate \Support \Facades \Blade ;
99use Laravel \Roster \Enums \Packages ;
10+ use Laravel \Roster \Package ;
1011use Laravel \Roster \Roster ;
1112use Symfony \Component \Finder \Exception \DirectoryNotFoundException ;
1213use Symfony \Component \Finder \Finder ;
@@ -30,6 +31,16 @@ class GuidelineComposer
3031 */
3132 protected array $ packagePriorities ;
3233
34+ /**
35+ * Only include guidelines for these package names if they're a direct requirement.
36+ * This fixes every Boost user getting the MCP guidelines due to indirect import.
37+ *
38+ * @var array<int, Packages>
39+ * */
40+ protected array $ mustBeDirect = [
41+ Packages::MCP ,
42+ ];
43+
3344 public function __construct (protected Roster $ roster , protected Herd $ herd )
3445 {
3546 $ this ->packagePriorities = [
@@ -131,7 +142,7 @@ protected function find(): Collection
131142 // We don't add guidelines for packages unsupported by Roster right now
132143 foreach ($ this ->roster ->packages () as $ package ) {
133144 // Skip packages that should be excluded due to priority rules
134- if ($ this ->shouldExcludePackage ($ package-> package ()-> value )) {
145+ if ($ this ->shouldExcludePackage ($ package )) {
135146 continue ;
136147 }
137148
@@ -173,18 +184,18 @@ protected function find(): Collection
173184 /**
174185 * Determines if a package should be excluded from guidelines based on priority rules.
175186 */
176- protected function shouldExcludePackage (string $ packageName ): bool
187+ protected function shouldExcludePackage (Package $ package ): bool
177188 {
178189 foreach ($ this ->packagePriorities as $ priorityPackage => $ excludedPackages ) {
179- if (in_array ($ packageName , $ excludedPackages , true )) {
190+ if (in_array ($ package -> package ()-> value , $ excludedPackages , true )) {
180191 $ priorityEnum = Packages::from ($ priorityPackage );
181192 if ($ this ->roster ->uses ($ priorityEnum )) {
182193 return true ;
183194 }
184195 }
185196 }
186197
187- return false ;
198+ return $ package -> indirect () && in_array ( $ package -> package (), $ this -> mustBeDirect , true ) ;
188199 }
189200
190201 /**
0 commit comments