feat: structure and content fingerprints, lit/library-find-similar

Fingerprint::structure()/content() (E11) and lit/library-find-similar
(indirect, group Divi-Bibliothek): at most 200 posts per call (cursor),
editable entries only (own posts without edit_others_posts), contents
primed in chunks of 50, stops at 200 matches or 5000 compared nodes with
a note; library entries and Theme Builder layouts are never scanned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 21:13:33 +02:00
co-authored by Claude Opus 5.5
parent 6be2e65432
commit f82964f617
7 changed files with 758 additions and 5 deletions
@@ -12,11 +12,13 @@ use LIT\MCP\Integrations\Divi\Pages\DiviSaver;
use LIT\MCP\Integrations\Divi\Pages\DiviWriter;
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
use LIT\MCP\Integrations\Integration;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
defined('ABSPATH') || exit;
/**
* The group "Divi-Bibliothek" (E9): lit/library-list, lit/library-save and lit-library-insert (direct).
* The group "Divi-Bibliothek" (E9): lit/library-list, lit/library-save, lit-library-insert (direct) and, with the
* content schema, lit/library-find-similar (E11).
* Built by DiviIntegration::library() so it shares the library access (rights, Tools-tab gates –
* its id LibraryAccess::GROUP is what the P9 hiding and the write gate ask). Available with the
* Divi 5 builder, like the Divi group.
@@ -32,7 +34,8 @@ final class LibraryIntegration implements Integration
private DiviSaver $saver,
private ChangeLog $log,
private DiviModules $modules,
private ?Closure $diviWritable = null
private ?Closure $diviWritable = null,
private ?ContentSchema $schema = null
) {
}
@@ -53,7 +56,7 @@ final class LibraryIntegration implements Integration
public function abilities(): array
{
return [
$abilities = [
new LibraryListAbility(
$this->access,
$this->loader,
@@ -70,5 +73,10 @@ final class LibraryIntegration implements Integration
),
new LibraryInsertAbility($this->writer, $this->access, $this->diviWritable),
];
if ($this->schema !== null) {
$abilities[] = new LibraryFindSimilarAbility($this->access, $this->loader, $this->schema);
}
return $abilities;
}
}