#!/usr/bin/env python3 """ Find a relevant image from the static database by matching a description against image tags, then validate and write the image to disk. Usage: python find-relevant-image.py Arguments: description - A description of where and how the image will be used (e.g. "hero banner for a travel blog about Japanese temples") The matched image is written to the outputs/ directory next to this script. The full output path is printed to stdout. """ import base64 import csv import hashlib import json import re import shutil import subprocess import sys import tempfile import urllib.request from pathlib import Path IMAGES_CSV = Path(__file__).resolve().parent.parent / "assets" / "images.csv" OUTPUT_DIR = Path(__file__).resolve().parent / "outputs" # The skill's source repository where new releases (including updated images) are published RELEASES_URL = "https://github.com/daniel-dan-conrad/ui-designer-releases/raw/refs/heads/main/ui-designer.zip" # Match a data row from `unzip -l`: `