feat: lit-site-status, Admin-Tab und Admin-Hinweis zeigen Divi-Fähigkeiten mit Zustand, Quelle, Problemen und betroffenen Werkzeugen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
b92545a8fe
commit
2aef6e1154
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace LIT\MCP\Integrations\Divi;
|
||||
|
||||
use Closure;
|
||||
use LIT\MCP\Abilities\Ability;
|
||||
use LIT\MCP\Abilities\ToolAvailability;
|
||||
use LIT\MCP\Admin\DiviTab;
|
||||
use LIT\MCP\Admin\SettingsPage;
|
||||
@@ -55,6 +56,7 @@ use LIT\MCP\Integrations\Divi\Pages\DynamicContentMap;
|
||||
use LIT\MCP\Integrations\Divi\Release\CompatibilityCheck;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviCheckRoute;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseResolver;
|
||||
use LIT\MCP\Integrations\Divi\Release\FeatureOverview;
|
||||
use LIT\MCP\Integrations\Divi\Schema\DiviCatalogAbility;
|
||||
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
|
||||
use LIT\MCP\Integrations\Divi\ThemeBuilder\DiviThemeBuilder;
|
||||
@@ -95,11 +97,14 @@ final class DiviIntegration implements Integration, Bootable
|
||||
* "Divi Theme Builder" gate their entries in the Divi tools (ruling P9, E9), lit/divi-insert gates
|
||||
* lit/divi-node-copy, lit-library-insert and content-create's divi input (audit M2), lit/library-insert
|
||||
* gates lit/divi-node-copy from a library entry (audit L5). null = no Tools tab: everything allowed.
|
||||
* @param (Closure(): list<Ability>)|null $allAbilities The abilities of every integration (Plugin passes
|
||||
* IntegrationRegistry::abilities()); the tools a Divi feature affects are found among them (E3).
|
||||
*/
|
||||
public function __construct(
|
||||
private ContentSchema $schema,
|
||||
private ChangeLog $log,
|
||||
private ?ToolAvailability $tools = null
|
||||
private ?ToolAvailability $tools = null,
|
||||
private ?Closure $allAbilities = null
|
||||
) {
|
||||
$this->modules = new DiviModules();
|
||||
$this->design = new DesignSystemReader();
|
||||
@@ -177,10 +182,16 @@ final class DiviIntegration implements Integration, Bootable
|
||||
return [new DiviLogoUsage()];
|
||||
}
|
||||
|
||||
/** Port for lit-site-status: Divi's version, missing internals and release status. */
|
||||
/** Which tools each Divi feature affects – for lit-site-status and the Divi tab (E3). */
|
||||
public function featureOverview(): FeatureOverview
|
||||
{
|
||||
return new FeatureOverview($this->allAbilities ?? static fn (): array => []);
|
||||
}
|
||||
|
||||
/** Port for lit-site-status: Divi's version, missing internals, release status and features. */
|
||||
public function environmentComponent(): EnvironmentComponent
|
||||
{
|
||||
return new DiviEnvironmentComponent();
|
||||
return new DiviEnvironmentComponent(overview: $this->featureOverview());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,7 +221,10 @@ final class DiviIntegration implements Integration, Bootable
|
||||
(new DiviCheckRoute($check))->register();
|
||||
DiviCheckCommand::register($check);
|
||||
|
||||
add_filter(SettingsPage::TABS_FILTER, fn (array $tabs): array => [...$tabs, new DiviTab(log: $this->log)]);
|
||||
add_filter(
|
||||
SettingsPage::TABS_FILTER,
|
||||
fn (array $tabs): array => [...$tabs, new DiviTab(log: $this->log, overview: $this->featureOverview())]
|
||||
);
|
||||
}
|
||||
|
||||
public function abilities(): array
|
||||
|
||||
Reference in New Issue
Block a user