#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "$0")" && pwd)" PROMPT_JSON="$ROOT_DIR/output/prompt.json" MANIFEST_JSON="$ROOT_DIR/manifest.json" if [ ! -f "$PROMPT_JSON" ]; then echo "[ERROR] prompt.json not found." exit 1 fi if ! command -v jq >/dev/null 2>&1; then echo "[ERROR] jq not found. Install jq first." exit 1 fi WORLD_ID=$(jq -r '.meta.world_id' "$PROMPT_JSON") WORLD_VERSION=$(jq -r '.meta.world_version' "$PROMPT_JSON") STYLE_ID=$(jq -r '.meta.style_id' "$PROMPT_JSON") SCENE_ID=$(jq -r '.meta.scene_id' "$PROMPT_JSON") TASK_TYPE=$(jq -r '.meta.task_type' "$PROMPT_JSON") if [[ "$WORLD_ID" == "null" || "$STYLE_ID" == "null" || "$TASK_TYPE" == "null" ]]; then echo "[ERROR] Invalid meta fields in prompt.json" exit 1 fi cat > "$MANIFEST_JSON" <