環境設定ファイルを追加し、make-json.shにエラーハンドリングとJSONスキーマのバリデーションを追加。新しいスクリプトpromote-manifest.shを作成し、マニフェスト生成のプロセスを強化。README.mdを更新し、プロンプト生成の構造を明確化。シーンとスタイルの登録ルールを整理し、スキーマファイルを追加。

This commit is contained in:
president
2025-12-20 20:37:27 +09:00
parent 5636d56609
commit aaa4f7de56
12 changed files with 685 additions and 217 deletions

50
promote-manifest.sh Normal file
View File

@@ -0,0 +1,50 @@
#!/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" <<EOF
{
"version": "1.0",
"world": {
"id": "$WORLD_ID",
"version": "$WORLD_VERSION"
},
"style": {
"id": "$STYLE_ID"
},
"scene": {
"id": "$SCENE_ID"
},
"task": {
"type": "$TASK_TYPE",
"prompt_ref": "output/prompt.json"
}
}
EOF
echo "[OK] manifest.json generated successfully."
echo "[DONE] $MANIFEST_JSON"