{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/motion-overlay-plan.schema.json",
  "title": "MotionOverlayPlan",
  "type": "object",
  "required": ["schemaVersion", "input", "layout", "style", "accent", "language", "workdir", "takes"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "input": {
      "type": "object",
      "required": ["path", "durationSeconds", "width", "height", "aspect"],
      "additionalProperties": false,
      "properties": {
        "path": { "type": "string", "minLength": 1 },
        "durationSeconds": { "type": "number", "minimum": 0 },
        "width": { "type": "integer", "minimum": 0 },
        "height": { "type": "integer", "minimum": 0 },
        "aspect": { "type": "string", "minLength": 1 }
      }
    },
    "layout": { "enum": ["split", "overlay", "motion-only", "avatar-host"] },
    "style": { "enum": ["apple-clean", "editorial-dark", "knowledge-tool"] },
    "accent": { "type": "string", "minLength": 1 },
    "language": { "type": "string", "minLength": 1 },
    "workdir": { "type": "string", "minLength": 1 },
    "takes": {
      "type": "array",
      "items": { "$ref": "#/definitions/MotionTake" }
    },
    "generatedAt": { "type": "string", "format": "date-time" }
  },
  "definitions": {
    "MotionTake": {
      "type": "object",
      "required": ["index", "start", "end", "durationSeconds", "file", "promptFile", "anatomy", "prompt"],
      "additionalProperties": false,
      "properties": {
        "index": { "type": "integer", "minimum": 0 },
        "start": { "type": "number", "minimum": 0 },
        "end": { "type": "number", "minimum": 0 },
        "durationSeconds": { "type": "number", "minimum": 0 },
        "file": { "type": "string", "minLength": 1 },
        "promptFile": { "type": "string", "minLength": 1 },
        "anatomy": { "enum": ["hook", "contextualize", "burst", "breath", "cta"] },
        "prompt": { "type": "string", "minLength": 1 }
      }
    }
  }
}
