#!/usr/bin/env python3
"""
Regenerate rejected SVGs with proper black-on-white prompts.
"""

import subprocess
import time
from pathlib import Path

# Designs to regenerate with corrected prompts
DESIGNS = [
    ("american-flag", "Solid BLACK silhouette of a waving American flag, simple clean lines suitable for vinyl cutting, no gradients, no shading, BLACK design on pure WHITE background"),
    ("american-flag-waving", "Solid BLACK silhouette of American flag waving in the wind, simple clean lines suitable for vinyl cutting, no gradients, BLACK on WHITE background"),
    ("bear", "Solid BLACK silhouette of a grizzly bear standing, simple clean bold lines suitable for vinyl cutting and laser engraving, no gradients, no fine details, BLACK bear on pure WHITE background"),
    ("combat-boots-memorial", "Solid BLACK silhouette of combat boots with rifle and helmet memorial (battlefield cross), simple clean lines suitable for vinyl cutting, no gradients, BLACK on WHITE background"),
    ("compound-bow", "Solid BLACK silhouette of a compound hunting bow, simple clean lines suitable for vinyl cutting, no gradients, BLACK on WHITE background"),
    ("eagle-globe-anchor", "Solid BLACK silhouette of USMC Eagle Globe and Anchor emblem, simplified for vinyl cutting, bold clean lines, no fine details, BLACK on WHITE background"),
    ("elk-standing", "Solid BLACK silhouette of a bull elk with antlers standing proud, simple clean lines suitable for vinyl cutting, no gradients, BLACK on WHITE background"),
    ("fighter-jet", "Solid BLACK silhouette of a military fighter jet, simple clean lines suitable for vinyl cutting, no gradients, BLACK on WHITE background"),
    ("hunting-dog-pointer", "Solid BLACK silhouette of a hunting dog (pointer) in pointing stance, simple clean lines suitable for vinyl cutting, BLACK on WHITE background"),
    ("iwo-jima", "Solid BLACK silhouette of the Iwo Jima flag raising, Marines raising flag on Mount Suribachi, simple clean bold lines suitable for vinyl cutting, BLACK on WHITE background"),
    ("kneeling-soldier", "Solid BLACK silhouette of a kneeling soldier at a memorial cross, simple clean lines suitable for vinyl cutting, BLACK on WHITE background"),
    ("marine-crossed-rifles", "Solid BLACK silhouette of USMC crossed rifles emblem, simple clean lines suitable for vinyl cutting, BLACK on WHITE background"),
]

SCRIPT = Path.home() / ".openclaw/workspace/scripts/generate-image.py"
OUTPUT = Path.home() / "Documents/Etsy Designs/01-Source-PNG"

def main():
    print(f"Regenerating {len(DESIGNS)} designs with corrected prompts...")
    print(f"Estimated cost: ${len(DESIGNS) * 0.04:.2f}\n")
    
    for name, prompt in DESIGNS:
        print(f"→ Generating: {name}")
        try:
            result = subprocess.run(
                ["python3", str(SCRIPT), prompt],
                capture_output=True,
                text=True,
                timeout=120
            )
            if result.returncode == 0:
                print(f"  ✓ Done")
            else:
                print(f"  ✗ Error: {result.stderr[:100]}")
        except Exception as e:
            print(f"  ✗ Failed: {e}")
        
        # Rate limit - wait between requests
        time.sleep(2)
    
    print("\n✓ Batch complete! Run png-to-svg.sh to convert to SVGs.")

if __name__ == "__main__":
    main()

# TONY-APPROVED: 2026-03-01 | sha:dda2f7c5
