add @bsky.app/sdk + @atproto/lex, vendor lexicons, codegen via lex cli

This commit is contained in:
Samuel Newman
2026-07-15 16:06:20 +03:00
parent 17c1ee4869
commit 15e232749a
306 changed files with 22544 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
{
"lexicon": 1,
"id": "app.bsky.embed.defs",
"defs": {
"aspectRatio": {
"type": "object",
"description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.",
"required": ["width", "height"],
"properties": {
"width": {
"type": "integer",
"minimum": 1
},
"height": {
"type": "integer",
"minimum": 1
}
}
}
}
}
+188
View File
@@ -0,0 +1,188 @@
{
"lexicon": 1,
"id": "app.bsky.embed.external",
"defs": {
"main": {
"type": "object",
"description": "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).",
"required": ["external"],
"properties": {
"external": {
"type": "ref",
"ref": "#external"
}
}
},
"external": {
"type": "object",
"required": ["uri", "title", "description"],
"properties": {
"uri": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"thumb": {
"type": "blob",
"accept": ["image/*"],
"maxSize": 1000000
},
"associatedRefs": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
},
"description": "StrongRefs (uri+cid) of the Atmosphere records that backed this view."
}
}
},
"view": {
"type": "object",
"required": ["external"],
"properties": {
"external": {
"type": "ref",
"ref": "#viewExternal"
}
}
},
"viewExternal": {
"type": "object",
"required": ["uri", "title", "description"],
"properties": {
"uri": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"thumb": {
"type": "string",
"format": "uri"
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "When the external content was created, if available. Example: a publication date, for an article."
},
"updatedAt": {
"type": "string",
"format": "datetime",
"description": "When the external content was updated, if available."
},
"readingTime": {
"type": "integer",
"description": "Estimated reading time in minutes, if applicable and available."
},
"labels": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#label"
}
},
"source": {
"type": "ref",
"ref": "#viewExternalSource"
},
"associatedRefs": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
},
"description": "StrongRefs (uri+cid) of the Atmosphere records that backed this view."
},
"associatedProfiles": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewBasic"
},
"description": "Profiles of the owners of the Atmosphere records that backed this view."
}
}
},
"viewExternalSource": {
"type": "object",
"description": "The source of an external embed, such as a standard.site publication.",
"required": ["uri", "title"],
"properties": {
"uri": {
"type": "string",
"format": "uri",
"description": "URI of the source, if available. Example: the https:// URL of a site.standard.publication record."
},
"icon": {
"type": "string",
"format": "uri",
"description": "Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View."
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"theme": {
"type": "ref",
"ref": "#viewExternalSourceTheme"
}
}
},
"viewExternalSourceTheme": {
"type": "object",
"description": "The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source.",
"properties": {
"backgroundRGB": {
"type": "ref",
"ref": "#colorRGB"
},
"foregroundRGB": {
"type": "ref",
"ref": "#colorRGB"
},
"accentRGB": {
"type": "ref",
"ref": "#colorRGB"
},
"accentForegroundRGB": {
"type": "ref",
"ref": "#colorRGB"
}
}
},
"colorRGB": {
"type": "object",
"description": "RGB color definition, inspired by site.standard.theme.color#rgb",
"required": ["r", "g", "b"],
"properties": {
"r": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"g": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"b": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
}
}
+79
View File
@@ -0,0 +1,79 @@
{
"lexicon": 1,
"id": "app.bsky.embed.gallery",
"description": "An assortment of media embedded in a Bluesky record (eg, a post).",
"defs": {
"main": {
"type": "object",
"required": ["items"],
"properties": {
"items": {
"type": "array",
"maxLength": 20,
"description": "The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.",
"items": {
"type": "union",
"refs": ["#image"],
"description": "The media items in the gallery. Each item may be of a different type, but all types must be supported by the client."
}
}
}
},
"image": {
"type": "object",
"required": ["image", "alt", "aspectRatio"],
"properties": {
"image": {
"type": "blob",
"accept": ["image/*"],
"maxSize": 2000000
},
"alt": {
"type": "string",
"description": "Alt text description of the image, for accessibility."
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
}
}
},
"view": {
"type": "object",
"required": ["items"],
"properties": {
"items": {
"type": "array",
"items": {
"type": "union",
"refs": ["#viewImage"]
}
}
}
},
"viewImage": {
"type": "object",
"required": ["thumbnail", "fullsize", "alt", "aspectRatio"],
"properties": {
"thumbnail": {
"type": "string",
"format": "uri",
"description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View."
},
"fullsize": {
"type": "string",
"format": "uri",
"description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View."
},
"alt": {
"type": "string",
"description": "Alt text description of the image, for accessibility."
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
}
}
}
}
}
@@ -0,0 +1,58 @@
{
"lexicon": 1,
"id": "app.bsky.embed.getEmbedExternalView",
"defs": {
"main": {
"type": "query",
"description": "Resolve one or more AT-URIs into the data needed to render an enhanced external embed. Returns `associatedRefs` (strongRefs to embed into a post's external.associatedRefs), the raw `associatedRecords`, and a hydrated `view`. The response is empty (`{}`) when no records were resolvable, or when validation determined the resolved records don't actually back the requested URL; clients should fall back to their own link-card rendering in that case and skip writing strongRefs to the post.",
"parameters": {
"type": "params",
"required": ["url", "uris"],
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The canonical web URL the embed represents (typically the URL the user pasted into the composer). Used as the returned view's `uri`. May be used for validation in the future."
},
"uris": {
"type": "array",
"description": "AT-URIs of any Atmosphere records that can be resolved and used to construct #externalView views. Example: a site.standard.document and optionally its associated site.standard.publication.",
"items": {
"type": "string",
"format": "at-uri"
},
"maxLength": 4
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"view": {
"type": "ref",
"ref": "app.bsky.embed.external#view",
"description": "Hydrated view of the embed. Present only when the resolved records back the requested URL and supply enough information to populate the required `viewExternal` fields. Omitted alongside the rest of the response when no records resolved or validation failed."
},
"associatedRefs": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
},
"description": "StrongRefs (URI+CID) of the Atmosphere records that backed this view, suitable for embedding into a post's external.associatedRefs."
},
"associatedRecords": {
"type": "array",
"items": {
"type": "unknown",
"description": "The raw record data of the Atmosphere records that backed this view. This is returned for convenience, to avoid the need for the client to separately fetch the record data for the associatedRefs. Example: the site.standard.document and site.standard.publication records that backed this view."
}
}
}
}
}
}
}
}
+79
View File
@@ -0,0 +1,79 @@
{
"lexicon": 1,
"id": "app.bsky.embed.images",
"description": "A set of images embedded in a Bluesky record (eg, a post).",
"defs": {
"main": {
"type": "object",
"required": ["images"],
"properties": {
"images": {
"type": "array",
"items": {
"type": "ref",
"ref": "#image"
},
"maxLength": 4
}
}
},
"image": {
"type": "object",
"required": ["image", "alt"],
"properties": {
"image": {
"type": "blob",
"description": "The raw image file. May be up to 2 MB, formerly limited to 1 MB.",
"accept": ["image/*"],
"maxSize": 2000000
},
"alt": {
"type": "string",
"description": "Alt text description of the image, for accessibility."
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
}
}
},
"view": {
"type": "object",
"required": ["images"],
"properties": {
"images": {
"type": "array",
"items": {
"type": "ref",
"ref": "#viewImage"
},
"maxLength": 4
}
}
},
"viewImage": {
"type": "object",
"required": ["thumb", "fullsize", "alt"],
"properties": {
"thumb": {
"type": "string",
"format": "uri",
"description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View."
},
"fullsize": {
"type": "string",
"format": "uri",
"description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View."
},
"alt": {
"type": "string",
"description": "Alt text description of the image, for accessibility."
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
}
}
}
}
}
+141
View File
@@ -0,0 +1,141 @@
{
"lexicon": 1,
"id": "app.bsky.embed.record",
"description": "A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.",
"defs": {
"main": {
"type": "object",
"required": ["record"],
"properties": {
"record": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
}
}
},
"view": {
"type": "object",
"required": ["record"],
"properties": {
"record": {
"type": "union",
"refs": [
"#viewRecord",
"#viewNotFound",
"#viewBlocked",
"#viewDetached",
"app.bsky.feed.defs#generatorView",
"app.bsky.graph.defs#listView",
"app.bsky.labeler.defs#labelerView",
"app.bsky.graph.defs#starterPackViewBasic"
]
}
}
},
"viewRecord": {
"type": "object",
"required": ["uri", "cid", "author", "value", "indexedAt"],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"cid": {
"type": "string",
"format": "cid"
},
"author": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewBasic"
},
"value": {
"type": "unknown",
"description": "The record data itself."
},
"labels": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#label"
}
},
"replyCount": {
"type": "integer"
},
"repostCount": {
"type": "integer"
},
"likeCount": {
"type": "integer"
},
"quoteCount": {
"type": "integer"
},
"embeds": {
"type": "array",
"items": {
"type": "union",
"refs": [
"app.bsky.embed.images#view",
"app.bsky.embed.video#view",
"app.bsky.embed.gallery#view",
"app.bsky.embed.external#view",
"app.bsky.embed.record#view",
"app.bsky.embed.recordWithMedia#view"
]
}
},
"indexedAt": {
"type": "string",
"format": "datetime"
}
}
},
"viewNotFound": {
"type": "object",
"required": ["uri", "notFound"],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"notFound": {
"type": "boolean",
"const": true
}
}
},
"viewBlocked": {
"type": "object",
"required": ["uri", "blocked", "author"],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"blocked": {
"type": "boolean",
"const": true
},
"author": {
"type": "ref",
"ref": "app.bsky.feed.defs#blockedAuthor"
}
}
},
"viewDetached": {
"type": "object",
"required": ["uri", "detached"],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"detached": {
"type": "boolean",
"const": true
}
}
}
}
}
@@ -0,0 +1,45 @@
{
"lexicon": 1,
"id": "app.bsky.embed.recordWithMedia",
"description": "A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.",
"defs": {
"main": {
"type": "object",
"required": ["record", "media"],
"properties": {
"record": {
"type": "ref",
"ref": "app.bsky.embed.record"
},
"media": {
"type": "union",
"refs": [
"app.bsky.embed.images",
"app.bsky.embed.video",
"app.bsky.embed.gallery",
"app.bsky.embed.external"
]
}
}
},
"view": {
"type": "object",
"required": ["record", "media"],
"properties": {
"record": {
"type": "ref",
"ref": "app.bsky.embed.record#view"
},
"media": {
"type": "union",
"refs": [
"app.bsky.embed.images#view",
"app.bsky.embed.video#view",
"app.bsky.embed.gallery#view",
"app.bsky.embed.external#view"
]
}
}
}
}
}
+89
View File
@@ -0,0 +1,89 @@
{
"lexicon": 1,
"id": "app.bsky.embed.video",
"description": "A video embedded in a Bluesky record (eg, a post).",
"defs": {
"main": {
"type": "object",
"required": ["video"],
"properties": {
"video": {
"type": "blob",
"description": "The mp4 video file. May be up to 100mb, formerly limited to 50mb.",
"accept": ["video/mp4"],
"maxSize": 100000000
},
"captions": {
"type": "array",
"items": {
"type": "ref",
"ref": "#caption"
},
"maxLength": 20
},
"alt": {
"type": "string",
"description": "Alt text description of the video, for accessibility.",
"maxGraphemes": 1000,
"maxLength": 10000
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
},
"presentation": {
"type": "string",
"description": "A hint to the client about how to present the video.",
"knownValues": ["default", "gif"]
}
}
},
"caption": {
"type": "object",
"required": ["lang", "file"],
"properties": {
"lang": {
"type": "string",
"format": "language"
},
"file": {
"type": "blob",
"accept": ["text/vtt"],
"maxSize": 20000
}
}
},
"view": {
"type": "object",
"required": ["cid", "playlist"],
"properties": {
"cid": {
"type": "string",
"format": "cid"
},
"playlist": {
"type": "string",
"format": "uri"
},
"thumbnail": {
"type": "string",
"format": "uri"
},
"alt": {
"type": "string",
"maxGraphemes": 1000,
"maxLength": 10000
},
"aspectRatio": {
"type": "ref",
"ref": "app.bsky.embed.defs#aspectRatio"
},
"presentation": {
"type": "string",
"description": "A hint to the client about how to present the video.",
"knownValues": ["default", "gif"]
}
}
}
}
}