feat: add variation spawner and content repurposing
Variation spawner: select an image asset → spawn N variations that keep the same emotional pattern/visual style but explore different hook angles. Runs a focused ad-creative-designer agent with the original as a Gemini reference image. New assets link back via parentAssetId. Content repurposing: resize an image to all other platform dimensions using Sharp (cover crop). Captions are re-toned for the target platform via Claude CLI. No external APIs needed — fully local. - Add parentAssetId self-relation to Asset model - lib/repurpose.ts: Sharp resize, platform format mapping, caption re-toning - lib/variations.ts: asset DNA extraction, variation prompt builder, mini-pipeline - API routes: /api/assets/[id]/repurpose (GET formats, POST resize) - API routes: /api/assets/[id]/variations (GET existing, POST spawn) - Repurpose modal: checkbox list of target formats - Variation modal: count picker, async launch - Asset card: Repurpose + Variations buttons on image assets - Asset lineage: "Derived from" shown on child assets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -83,6 +83,9 @@ model Asset {
|
||||
publishedTo String? // JSON array of platforms published to
|
||||
postizPostId String?
|
||||
postizMediaId String?
|
||||
parentAssetId String?
|
||||
parentAsset Asset? @relation("AssetVariations", fields: [parentAssetId], references: [id])
|
||||
variations Asset[] @relation("AssetVariations")
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user