{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agenticdecks.com/schemas/v1/deckrun-slide.json",
  "$comment": "© 2026 Agentic Decks. Publicly readable. Not open source. See https://agenticdecks.com/schemas for usage terms.",
  "title": "Deckrun deck (logical structure)",
  "description": "Deckrun slide schema is a renderer-independent intermediate representation (IR) for presentations. It is designed for deterministic transformation into multiple output formats (PDF, PPTX, video, HTML). Logical structure of a parsed slide deck; validate a JSON representation after parsing markdown. The Markdown surface form is described in the slide-format response (surface_syntax). Schema version is in $id (e.g. v1); agents and caches should use $id for versioning.",
  "type": "object",
  "required": [ "slides" ],
  "properties": {
    "slides": {
      "type": "array",
      "description": "Ordered list of slides.",
      "items": { "$ref": "#/$defs/slide" }
    }
  },
  "$defs": {
    "notesSegment": {
      "type": "object",
      "description": "A single presenter-notes block for TTS narration. Maps to one <!-- <slide-notes> --> ... <!-- </slide-notes> --> section in the markdown.",
      "required": ["text"],
      "properties": {
        "text": {
          "type": "string",
          "description": "HTML of this notes block (converted from the markdown source). Strip HTML tags to get plain text for TTS."
        },
        "language": {
          "type": [ "string", "null" ],
          "description": "BCP-47 language code for TTS narration of this segment (e.g. \"ta-IN\", \"en-US\"). Null = use TtsConfig.default_language. Set via <!-- <slide-notes language=\"ta-IN\"> -->."
        }
      }
    },
    "slide": {
      "type": "object",
      "description": "A single slide with layout, content, notes, and optional attributes. For two-content layout, content may be split into left_content and right_content; optional full_width_content follows after <!-- <end-special-format /> -->.",
      "required": [ "layout" ],
      "properties": {
        "layout": {
          "type": "string",
          "enum": [
            "title",
            "default",
            "title-content",
            "section-header",
            "two-content",
            "title-only",
            "title-no-footer",
            "footer-only",
            "full-blank",
            "blank",
            "content-caption"
          ],
          "description": "Slide layout. Primary hint, not exclusive: e.g. two-content may still contain images or code; renderers may enforce monospacing for code in content. Maps from Markdown tags (e.g. <!-- <title-slide /> -->) or <layout>...</layout>."
        },
        "content": {
          "type": "string",
          "description": "Raw markdown body of the slide (excluding layout/attribute comments). When left_content and right_content are present, content may be the unsplit body or omitted."
        },
        "left_content": {
          "type": "string",
          "description": "Optional. For two-content layout: content before <!-- <right-side /> -->. Omitted if not split."
        },
        "right_content": {
          "type": "string",
          "description": "Optional. For two-content layout: content between <!-- <right-side /> --> and <!-- <end-special-format /> --> (or end of slide). Omitted if not split."
        },
        "full_width_content": {
          "type": "string",
          "description": "Optional. Content after <!-- <end-special-format /> --> on the same slide; rendered full-width below columns. Only relevant for two-content layout."
        },
        "notes": {
          "type": [ "string", "null" ],
          "description": "Presenter notes as HTML (combined from all <!-- <slide-notes> --> blocks on the slide). Used for HTML/PDF notes display. For per-segment TTS narration, use notes_segments."
        },
        "notes_language": {
          "type": [ "string", "null" ],
          "description": "BCP-47 language code from the first <!-- <slide-notes language=\"...\"> --> block, e.g. \"ta-IN\". Null when no per-slide override is set; callers apply TtsConfig.default_language."
        },
        "notes_segments": {
          "type": "array",
          "description": "Individual notes segments for TTS narration. Each <!-- <slide-notes> --> block on the slide produces one entry, preserving its own language. Order matches narration order. Empty when the slide has no notes.",
          "items": { "$ref": "#/$defs/notesSegment" }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": { "type": "string" },
          "description": "Optional attributes (class, left_class, right_class, image, background_img, body_background_img, left_image, right_image, left_background_img, right_background_img, slide_timer, video_src, youtube_url, video_audio_mode, video_start_secs, video_end_secs, video_duck_db). video_src and youtube_url are mutually exclusive. All attributes are advisory; renderers may interpret or ignore. Image/video path values: use relative paths from the markdown file's directory (e.g. images/foo.png, videos/demo.mp4, or ./images/foo.png — leading ./ is normalized before resolution). Path traversal with '../' and absolute paths are rejected in all modes (security). In POST /generate, provide matching keys in the assets map as base64. Additional properties allowed for renderer-specific extensions."
        }
      }
    }
  }
}
