{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/dialogue.schema.json",
  "title": "DialogueArtifact",
  "type": "object",
  "required": ["schemaVersion", "projectSlug", "generatedAt", "backendId", "turns"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "projectSlug": { "type": "string", "minLength": 1 },
    "generatedAt": { "type": "string", "format": "date-time" },
    "backendId": { "type": "string", "minLength": 1 },
    "turns": {
      "type": "array",
      "items": { "$ref": "#/definitions/DialogueClip" }
    }
  },
  "definitions": {
    "DialogueClip": {
      "type": "object",
      "required": ["name", "line", "path", "durationMs"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Character name."
        },
        "voice": {
          "type": "string",
          "minLength": 1,
          "description": "Optional per-turn voice id forwarded to the TTS backend."
        },
        "line": {
          "type": "string",
          "minLength": 1,
          "description": "The spoken line that was synthesized."
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Project-relative path to the generated audio clip."
        },
        "durationMs": {
          "type": "number",
          "minimum": 0,
          "description": "Duration of the synthesized clip in milliseconds."
        }
      }
    }
  }
}
