Overview
The Media AI package adds optional AI-backed image actions to Capell’s existing media resource. It does not replace the media backend, crop system, or localized metadata model.
Status: Optional · Surface: Admin · Depends on: capell-app/admin, capell-app/core


What It Adds
Section titled “What It Adds”- A
Doctor imageaction on image records in the Media resource. - A small form for the editor to choose the image operation and add instructions.
- A
Capell\MediaAI\Contracts\ImageDoctorcontract that an ai-orchestrator package can bind to the real image-editing implementation. - A safe default
NullImageDoctor, so installing the package never exposes a broken action before an AI driver is configured.
Editor Flow
Section titled “Editor Flow”- Upload or open an image in Admin > Media.
- Select
Doctor image. - Choose the operation, such as background removal or cleanup.
- Add short instructions.
- Submit the action.
When an ImageDoctor implementation returns a replacement media record, the notification links the editor to the generated image. If the implementation only returns a warning, the original media record remains unchanged.
Integration Contract
Section titled “Integration Contract”AIOrchestrator-backed packages should bind the contract in their service provider:
use Capell\MediaAI\Contracts\ImageDoctor;
$this->app->bind(ImageDoctor::class, AIOrchestratorImageDoctor::class);The implementation receives the current media record and an ImageDoctorRequest. It returns an ImageDoctorResult with a success message, optional replacement media, and optional warning.
Boundaries
Section titled “Boundaries”- Cropping remains owned by Curator when
capell.media.backendiscurator. - Spatie installs use Capell’s fallback focal-point and crop-preset UI.
- Localized alt text, captions, credits, and decorative flags are stored in the shared
translations.metaJSON column.