{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scriptseen-com/json-schema/scriptseen-com-realtime-coach-body-schema.json",
  "title": "RealtimeCoachBody",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scriptseen-com-openapi.json#/components/schemas/RealtimeCoachBody",
  "properties": {
    "sdp": {
      "type": "string",
      "maxLength": 50000,
      "minLength": 20,
      "title": "Sdp"
    },
    "mode": {
      "type": "string",
      "enum": [
        "practice",
        "studio_brief",
        "journey"
      ],
      "title": "Mode",
      "default": "practice"
    },
    "line": {
      "type": "string",
      "maxLength": 1200,
      "minLength": 1,
      "title": "Line",
      "default": "Studio script brief"
    },
    "delivery_note": {
      "type": "string",
      "maxLength": 500,
      "title": "Delivery Note",
      "default": ""
    },
    "punches": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 12,
      "title": "Punches"
    },
    "target_seconds": {
      "type": "number",
      "maximum": 60.0,
      "minimum": 0.5,
      "title": "Target Seconds",
      "default": 5.0
    },
    "feedback_language": {
      "type": "string",
      "maxLength": 8,
      "title": "Feedback Language",
      "default": "en"
    },
    "context": {
      "$ref": "#/$defs/RealtimeScriptContext"
    },
    "brief": {
      "$ref": "#/$defs/RealtimeStudioBrief"
    },
    "script_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9_.:-]+$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Script Id"
    },
    "practice_session_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Practice Session Id"
    },
    "attempt_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Attempt Id"
    }
  },
  "type": "object",
  "required": [
    "sdp"
  ],
  "$defs": {
    "RealtimeScriptContext": {
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 300,
          "title": "Title",
          "default": ""
        },
        "full_script": {
          "type": "string",
          "maxLength": 8000,
          "title": "Full Script",
          "default": ""
        },
        "previous_line": {
          "type": "string",
          "maxLength": 1200,
          "title": "Previous Line",
          "default": ""
        },
        "next_line": {
          "type": "string",
          "maxLength": 1200,
          "title": "Next Line",
          "default": ""
        },
        "line_number": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 500.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Line Number"
        },
        "total_lines": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 500.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Lines"
        },
        "narrative_role": {
          "type": "string",
          "maxLength": 40,
          "title": "Narrative Role",
          "default": ""
        },
        "speaker": {
          "type": "string",
          "maxLength": 80,
          "title": "Speaker",
          "default": ""
        },
        "topic": {
          "type": "string",
          "maxLength": 4000,
          "title": "Topic",
          "default": ""
        },
        "audience": {
          "type": "string",
          "maxLength": 300,
          "title": "Audience",
          "default": ""
        },
        "platform": {
          "type": "string",
          "maxLength": 40,
          "title": "Platform",
          "default": ""
        },
        "tone": {
          "type": "string",
          "maxLength": 300,
          "title": "Tone",
          "default": ""
        },
        "total_target_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 600.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Target Seconds"
        },
        "delivery_style": {
          "type": "string",
          "maxLength": 800,
          "title": "Delivery Style",
          "default": ""
        },
        "story_intent": {
          "type": "string",
          "maxLength": 1500,
          "title": "Story Intent",
          "default": ""
        }
      },
      "type": "object",
      "title": "RealtimeScriptContext",
      "description": "Bounded story context that helps the coach understand one selected line."
    },
    "RealtimeStudioBrief": {
      "properties": {
        "topic": {
          "type": "string",
          "maxLength": 4000,
          "title": "Topic",
          "default": ""
        },
        "audience": {
          "type": "string",
          "maxLength": 500,
          "title": "Audience",
          "default": ""
        },
        "platform": {
          "type": "string",
          "enum": [
            "tiktok",
            "reels",
            "youtube-shorts"
          ],
          "title": "Platform",
          "default": "tiktok"
        },
        "duration": {
          "type": "integer",
          "maximum": 180.0,
          "minimum": 10.0,
          "title": "Duration",
          "default": 30
        },
        "confirmed_fields": {
          "items": {
            "type": "string",
            "enum": [
              "topic",
              "audience",
              "platform",
              "duration"
            ]
          },
          "type": "array",
          "maxItems": 4,
          "title": "Confirmed Fields"
        }
      },
      "type": "object",
      "title": "RealtimeStudioBrief",
      "description": "The editable Studio fields shared with Scout at session start."
    }
  }
}