{
"id": "pub.chive.richtext.defs",
"defs": {
"facet": {
"type": "object",
"required": [
"index",
"features"
],
"properties": {
"index": {
"ref": "#byteSlice",
"type": "ref"
},
"features": {
"type": "array",
"items": {
"refs": [
"pub.chive.richtext.facets#bold",
"pub.chive.richtext.facets#italic",
"pub.chive.richtext.facets#strikethrough",
"pub.chive.richtext.facets#code",
"pub.chive.richtext.facets#latex",
"#linkFacet"
],
"type": "union"
}
}
},
"description": "ATProto-compatible facet for rich text formatting within a text item"
},
"tagItem": {
"type": "object",
"required": [
"type",
"tag"
],
"properties": {
"tag": {
"type": "string",
"maxLength": 100,
"description": "Tag without # prefix"
},
"type": {
"type": "string",
"const": "tag"
}
},
"description": "Hashtag reference"
},
"linkItem": {
"type": "object",
"required": [
"type",
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string",
"const": "link"
},
"label": {
"type": "string",
"maxLength": 500
}
},
"description": "Inline hyperlink"
},
"listItem": {
"type": "object",
"required": [
"type",
"content",
"listType"
],
"properties": {
"type": {
"type": "string",
"const": "listItem"
},
"depth": {
"type": "integer",
"maximum": 5,
"minimum": 0
},
"content": {
"type": "string",
"maxLength": 2000
},
"ordinal": {
"type": "integer",
"minimum": 1
},
"listType": {
"type": "string",
"knownValues": [
"bullet",
"ordered"
]
}
},
"description": "List item"
},
"textItem": {
"type": "object",
"required": [
"type",
"content"
],
"properties": {
"type": {
"type": "string",
"const": "text"
},
"facets": {
"type": "array",
"items": {
"ref": "#facet",
"type": "ref"
},
"maxLength": 500,
"description": "ATProto-style facets for rich text formatting"
},
"content": {
"type": "string",
"maxLength": 100000,
"description": "Text content",
"maxGraphemes": 50000
}
},
"description": "Plain text content item with optional formatting facets"
},
"byteSlice": {
"type": "object",
"required": [
"byteStart",
"byteEnd"
],
"properties": {
"byteEnd": {
"type": "integer",
"minimum": 0,
"description": "End byte position (exclusive)"
},
"byteStart": {
"type": "integer",
"minimum": 0,
"description": "Start byte position (inclusive)"
}
},
"description": "Byte range for facet positioning"
},
"latexItem": {
"type": "object",
"required": [
"type",
"content"
],
"properties": {
"type": {
"type": "string",
"const": "latex"
},
"content": {
"type": "string",
"maxLength": 5000
},
"displayMode": {
"type": "boolean",
"description": "True for block display ($$...$$), false for inline ($...$)"
}
},
"description": "Standalone LaTeX math expression"
},
"linkFacet": {
"type": "object",
"required": [
"$type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "uri",
"description": "Link target URL"
},
"$type": {
"type": "string",
"const": "app.bsky.richtext.facet#link"
}
},
"description": "Hyperlink facet"
},
"headingItem": {
"type": "object",
"required": [
"type",
"content",
"level"
],
"properties": {
"type": {
"type": "string",
"const": "heading"
},
"level": {
"type": "integer",
"maximum": 6,
"minimum": 1
},
"content": {
"type": "string",
"maxLength": 500
}
},
"description": "Heading (for abstracts and reviews, not titles)"
},
"mentionItem": {
"type": "object",
"required": [
"type",
"did"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"type": {
"type": "string",
"const": "mention"
},
"handle": {
"type": "string",
"description": "Handle at time of mention"
}
},
"description": "ATProto-style mention (@handle)"
},
"nodeRefItem": {
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the referenced node"
},
"type": {
"type": "string",
"const": "nodeRef"
},
"label": {
"type": "string",
"maxLength": 500,
"description": "Display label (cached from node)"
},
"subkind": {
"type": "string",
"maxLength": 50,
"description": "Node subkind slug for styling (field, institution, person, etc.)"
}
},
"description": "Knowledge graph node reference"
},
"facetRefItem": {
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"type": {
"type": "string",
"const": "facetRef"
},
"label": {
"type": "string",
"maxLength": 500
}
},
"description": "Facet classification node reference"
},
"fieldRefItem": {
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"type": {
"type": "string",
"const": "fieldRef"
},
"label": {
"type": "string",
"maxLength": 500
}
},
"description": "Academic field node reference"
},
"authorRefItem": {
"type": "object",
"required": [
"type",
"did"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"type": {
"type": "string",
"const": "authorRef"
},
"label": {
"type": "string",
"maxLength": 200,
"description": "Display name"
}
},
"description": "Reference to an author by DID"
},
"codeBlockItem": {
"type": "object",
"required": [
"type",
"content"
],
"properties": {
"type": {
"type": "string",
"const": "codeBlock"
},
"content": {
"type": "string",
"maxLength": 50000
},
"language": {
"type": "string",
"maxLength": 50
}
},
"description": "Code block"
},
"eprintRefItem": {
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"type": {
"type": "string",
"const": "eprintRef"
},
"label": {
"type": "string",
"maxLength": 500,
"description": "Eprint title for display"
}
},
"description": "Reference to another eprint"
},
"blockquoteItem": {
"type": "object",
"required": [
"type",
"content"
],
"properties": {
"type": {
"type": "string",
"const": "blockquote"
},
"content": {
"type": "string",
"maxLength": 5000
}
},
"description": "Blockquote"
},
"wikidataRefItem": {
"type": "object",
"required": [
"type",
"qid"
],
"properties": {
"qid": {
"type": "string",
"maxLength": 20,
"description": "Wikidata QID (e.g., Q12345)"
},
"type": {
"type": "string",
"const": "wikidataRef"
},
"label": {
"type": "string",
"maxLength": 500,
"description": "Display label"
}
},
"description": "Wikidata entity reference"
},
"annotationRefItem": {
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"type": {
"type": "string",
"const": "annotationRef"
},
"label": {
"type": "string",
"maxLength": 500,
"description": "Text excerpt for preview"
}
},
"description": "Reference to an annotation or review"
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"revision": 1,
"description": "Shared definitions for unified rich text in Chive. All rich text content (abstracts, review bodies, annotation bodies, titles) references these types."
}