feat: batch media metadata updates and delete with usage check

lit/media-update validates the whole batch first (edit_post, lengths, optional
modified lock) and restores already written items when a write fails midway.
lit/media-delete requires confirm, refuses used media without force and
reports refused deletes as write_failed.

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:
2026-09-26 02:49:41 +02:00
co-authored by Claude Opus 5.5
parent 56f561c436
commit 931ddeb137
9 changed files with 1145 additions and 1 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ use LIT\MCP\Limits;
/**
* Media library tools (spec §6.3). Always available. $log and $limits serve the write
* tools (upload now, update and delete to follow).
* tools (upload, update, delete).
*/
final class MediaIntegration implements Integration
{
@@ -43,6 +43,8 @@ final class MediaIntegration implements Integration
new MediaUploadFromUrlAbility($importer, $uploads),
new MediaUploadAbility($importer, $uploads, $this->limits),
new MediaDownloadAbility($this->limits),
new MediaUpdateAbility($this->log),
new MediaDeleteAbility($finder, $this->log),
];
}
}