{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A thread (topic) opened in a forum-kind channel. Written into the opener's own repo within the space. The thread carries its own body; comments are tech.tokimeki.forum.message records referencing it.",
      "key": "tid",
      "record": {
        "properties": {
          "blobs": {
            "description": "Images placed inline in `content`. Uploaded with com.atproto.repo.uploadBlob to the author's PDS; each `content` image node carries the cid of one of these blobs.",
            "items": {
              "ref": "tech.tokimeki.forum.defs#image",
              "type": "ref"
            },
            "maxLength": 20,
            "type": "array"
          },
          "channel": {
            "description": "Space record URI of the tech.tokimeki.forum.channel this thread belongs to. A channel is a mutable container, so it is referenced by URI alone (like app.bsky.graph.listitem).",
            "format": "at-uri",
            "type": "string"
          },
          "content": {
            "description": "Rich body as a ProseMirror/TipTap document tree: paragraphs, headings (2-4), lists, task lists, quotes, code blocks, tables, callouts, toggles, link cards, mentions and images. Image nodes reference an entry of `blobs` by cid. When present, `text` is the plain-text projection of this tree for search, previews and text-only clients.",
            "ref": "#richContent",
            "type": "ref"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "editedAt": {
            "description": "Set when the thread was edited in place (putRecord with the same rkey).",
            "format": "datetime",
            "type": "string"
          },
          "embed": {
            "refs": [
              "tech.tokimeki.forum.defs#images"
            ],
            "type": "union"
          },
          "facets": {
            "items": {
              "ref": "app.bsky.richtext.facet",
              "type": "ref"
            },
            "type": "array"
          },
          "labels": {
            "description": "Self-applied labels, e.g. for adult content.",
            "refs": [
              "com.atproto.label.defs#selfLabels"
            ],
            "type": "union"
          },
          "langs": {
            "description": "Languages of the title and text (BCP-47).",
            "items": {
              "format": "language",
              "type": "string"
            },
            "maxLength": 3,
            "type": "array"
          },
          "tags": {
            "items": {
              "maxGraphemes": 32,
              "maxLength": 320,
              "type": "string"
            },
            "maxLength": 8,
            "type": "array"
          },
          "text": {
            "maxGraphemes": 5000,
            "maxLength": 40000,
            "type": "string"
          },
          "title": {
            "maxGraphemes": 128,
            "maxLength": 1280,
            "type": "string"
          }
        },
        "required": [
          "channel",
          "title",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "richContent": {
      "description": "A ProseMirror/TipTap document node (recursive). Consumers validate against the node whitelist in the app; unknown node types are ignored.",
      "properties": {
        "attrs": {
          "description": "Node attributes (heading level, image cid/alt/size, link card url…).",
          "type": "unknown"
        },
        "content": {
          "description": "Child nodes.",
          "items": {
            "type": "unknown"
          },
          "type": "array"
        },
        "marks": {
          "description": "Inline marks on a text node: bold, italic, strike, underline, code, link{href}.",
          "items": {
            "type": "unknown"
          },
          "type": "array"
        },
        "text": {
          "description": "Text of a text node.",
          "type": "string"
        },
        "type": {
          "description": "Node type (doc, paragraph, heading, text, hardBreak, mention, bulletList, orderedList, listItem, taskList, taskItem, blockquote, codeBlock, horizontalRule, image, table, tableRow, tableCell, tableHeader, callout, details, linkCard).",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "id": "tech.tokimeki.forum.thread",
  "lexicon": 1
}
