{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aidemos-com/json-schema/aidemos-com-shape-request-schema.json",
  "title": "ShapeRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aidemos-com-content-api-openapi.yml#/components/schemas/ShapeRequest",
  "properties": {
    "platform": {
      "type": "string",
      "enum": [
        "twitter",
        "youtube-community",
        "youtube-script",
        "linkedin"
      ],
      "title": "Platform",
      "default": "twitter"
    },
    "source": {
      "anyOf": [
        {
          "$ref": "#/$defs/SourceIn"
        },
        {
          "type": "null"
        }
      ],
      "description": "Legacy/raw source. Prefer topic for sip-grounded generation."
    },
    "topic": {
      "anyOf": [
        {
          "$ref": "#/$defs/TopicIn"
        },
        {
          "type": "null"
        }
      ],
      "description": "Durable sip source identity for tool/ranking generation."
    },
    "artifacts": {
      "items": {
        "$ref": "#/$defs/ArtifactIn"
      },
      "type": "array",
      "title": "Artifacts",
      "description": "Choosable artifact pool"
    },
    "artifact_filenames": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Artifact Filenames",
      "description": "Exact filenames selected from the topic bundle. Empty means the full pool."
    },
    "instructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instructions"
    },
    "insights": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Insights",
      "description": "Pre-comprehended insight-library context block"
    }
  },
  "type": "object",
  "$defs": {
    "ArtifactIn": {
      "properties": {
        "filename": {
          "type": "string",
          "title": "Filename"
        },
        "artifactType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Artifacttype"
        },
        "alt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Alt"
        },
        "caption": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Caption"
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Width"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Height"
        }
      },
      "type": "object",
      "required": [
        "filename"
      ],
      "title": "ArtifactIn"
    },
    "SourceIn": {
      "properties": {
        "title": {
          "type": "string",
          "title": "Title"
        },
        "page_url": {
          "type": "string",
          "title": "Page Url",
          "description": "Canonical public URL of the source page",
          "default": ""
        },
        "markdown": {
          "type": "string",
          "title": "Markdown",
          "description": "Clean markdown of the full source"
        }
      },
      "type": "object",
      "required": [
        "title",
        "markdown"
      ],
      "title": "SourceIn"
    },
    "TopicIn": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "tool",
            "ranking"
          ],
          "title": "Kind",
          "description": "'tool' (ref=tool slug) or 'ranking' (ref=research_task id)"
        },
        "ref": {
          "type": "string",
          "title": "Ref",
          "description": "Tool slug (kind=tool) or research_task id (kind=ranking)"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "ref"
      ],
      "title": "TopicIn"
    }
  }
}