feat: jedes Divi-Tool und lit/content-create erklärt seine Divi-Fähigkeiten (RequiresDiviFeatures, DeclaresRequirements, FeatureSets); Tabelle Tool → Fähigkeiten als Test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
e387d8d29e
commit
fdbda8012c
@@ -8,6 +8,8 @@ use Closure;
|
||||
use LIT\MCP\Abilities\Ability;
|
||||
use LIT\MCP\Abilities\Annotations;
|
||||
use LIT\MCP\Abilities\Errors;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
|
||||
use LIT\MCP\Integrations\Divi\Release\RequiresDiviFeatures;
|
||||
use WP_Error;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -17,7 +19,7 @@ defined('ABSPATH') || exit;
|
||||
* to the current state, confirm with design_rev, and first a snapshot of the current state, so a restore can be
|
||||
* undone as well. Etappe 4a restores presets; the other areas follow with their tools (4c, 4d).
|
||||
*/
|
||||
final class DiviDesignRestoreAbility implements Ability
|
||||
final class DiviDesignRestoreAbility implements Ability, RequiresDiviFeatures
|
||||
{
|
||||
private const ID = '/^(colors|variables|presets|theme_options)-\d{8}T\d{6}Z-[0-9a-f]{6}$/D';
|
||||
|
||||
@@ -76,6 +78,12 @@ final class DiviDesignRestoreAbility implements Ability
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Writes a stored snapshot back through the preset area (PresetWrite, reading it first: DesignRead). */
|
||||
public function diviFeatures(array $input): array
|
||||
{
|
||||
return [DiviFeature::DesignRead, DiviFeature::PresetWrite];
|
||||
}
|
||||
|
||||
public function permission(array $input): bool|WP_Error
|
||||
{
|
||||
return DesignRights::presets($this->writer) ?? true;
|
||||
|
||||
Reference in New Issue
Block a user