feat: lit/divi-insert and lit/divi-update
All-or-nothing at ability level (S39), duplicate ids refused (S14), set and attrs on the same path refused (S38), invalid_attr_path error. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -4,11 +4,17 @@ declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Divi;
|
||||
|
||||
use LIT\MCP\ChangeLog\ChangeLog;
|
||||
use LIT\MCP\Integrations\Divi\Design\DesignSystemReader;
|
||||
use LIT\MCP\Integrations\Divi\Design\DiviDesignSystemAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviComposition;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviInsertAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviNodeGetAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviOutlineAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviPageLoader;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviSaver;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviUpdateAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviWriter;
|
||||
use LIT\MCP\Integrations\Divi\Schema\DiviCatalogAbility;
|
||||
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
|
||||
use LIT\MCP\Integrations\Integration;
|
||||
@@ -16,14 +22,15 @@ use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
|
||||
|
||||
/**
|
||||
* Divi 5 pages (spec §5, Etappe 2). Only available when the Divi 5 builder is loaded
|
||||
* (spec §2 principle 4); Divi 4 is never edited (spec §3.4).
|
||||
* (spec §2 principle 4); Divi 4 is never edited (spec §3.4). The write abilities share one
|
||||
* DiviWriter; each binds the composition to its entry via DiviWriter::composition().
|
||||
*/
|
||||
final class DiviIntegration implements Integration
|
||||
{
|
||||
private DiviModules $modules;
|
||||
private DesignSystemReader $design;
|
||||
|
||||
public function __construct(private ContentSchema $schema)
|
||||
public function __construct(private ContentSchema $schema, private ChangeLog $log)
|
||||
{
|
||||
$this->modules = new DiviModules();
|
||||
$this->design = new DesignSystemReader();
|
||||
@@ -42,12 +49,16 @@ final class DiviIntegration implements Integration
|
||||
public function abilities(): array
|
||||
{
|
||||
$loader = new DiviPageLoader($this->schema);
|
||||
$composition = new DiviComposition($this->modules, $this->design);
|
||||
$writer = new DiviWriter($loader, new DiviSaver(), $this->log, $this->design, $composition);
|
||||
|
||||
return [
|
||||
new DiviOutlineAbility($loader, $this->design),
|
||||
new DiviNodeGetAbility($loader, $this->design),
|
||||
new DiviCatalogAbility($this->modules),
|
||||
new DiviDesignSystemAbility($this->design),
|
||||
new DiviInsertAbility($writer),
|
||||
new DiviUpdateAbility($writer),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user