add lexicon codegen: vendored lexicons, lex cli and generation scripts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-03 12:06:59 +03:00
parent a2129885c6
commit a3243820c9
311 changed files with 23342 additions and 14 deletions
+81
View File
@@ -0,0 +1,81 @@
{
"id": "chat.bsky.moderation.defs",
"defs": {
"convoView": {
"type": "object",
"required": [
"id",
"rev"
],
"properties": {
"id": {
"type": "string"
},
"rev": {
"type": "string"
},
"kind": {
"refs": [
"#directConvo",
"#groupConvo"
],
"type": "union",
"description": "Union field that has data specific to different kinds of convos."
}
},
"description": "A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members."
},
"groupConvo": {
"type": "object",
"required": [
"createdAt",
"joinRequestCount",
"lockStatus",
"memberCount",
"memberLimit",
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 500,
"description": "The display name of the group conversation.",
"maxGraphemes": 50
},
"joinLink": {
"ref": "chat.bsky.group.defs#joinLinkView",
"type": "ref"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"lockStatus": {
"ref": "chat.bsky.convo.defs#convoLockStatus",
"type": "ref",
"description": "The lock status of the conversation."
},
"memberCount": {
"type": "integer",
"description": "The total number of members in the group conversation."
},
"memberLimit": {
"type": "integer",
"description": "The maximum number of members allowed in the group conversation."
},
"joinRequestCount": {
"type": "integer",
"description": "The total number of pending join requests for the group conversation. This information is only visible to the owner and to moderators. Capped at 21."
}
},
"description": "Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation."
},
"directConvo": {
"type": "object",
"properties": {},
"description": "Data specific to a direct conversation, for moderation purposes."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,70 @@
{
"id": "chat.bsky.moderation.getActorMetadata",
"defs": {
"main": {
"type": "query",
"output": {
"schema": {
"type": "object",
"required": [
"day",
"month",
"all"
],
"properties": {
"all": {
"ref": "#metadata",
"type": "ref"
},
"day": {
"ref": "#metadata",
"type": "ref"
},
"month": {
"ref": "#metadata",
"type": "ref"
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"required": [
"actor"
],
"properties": {
"actor": {
"type": "string",
"format": "did"
}
}
}
},
"metadata": {
"type": "object",
"required": [
"messagesSent",
"messagesReceived",
"convos",
"convosStarted"
],
"properties": {
"convos": {
"type": "integer"
},
"messagesSent": {
"type": "integer"
},
"convosStarted": {
"type": "integer"
},
"messagesReceived": {
"type": "integer"
}
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,42 @@
{
"id": "chat.bsky.moderation.getConvo",
"defs": {
"main": {
"type": "query",
"errors": [
{
"name": "InvalidConvo"
}
],
"output": {
"schema": {
"type": "object",
"required": [
"convo"
],
"properties": {
"convo": {
"ref": "chat.bsky.moderation.defs#convoView",
"type": "ref"
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"required": [
"convoId"
],
"properties": {
"convoId": {
"type": "string"
}
}
},
"description": "Gets an existing conversation by its ID, for moderation purposes. Does not require the requester to be a member of the conversation."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,57 @@
{
"id": "chat.bsky.moderation.getConvoMembers",
"defs": {
"main": {
"type": "query",
"errors": [
{
"name": "InvalidConvo"
}
],
"output": {
"schema": {
"type": "object",
"required": [
"members"
],
"properties": {
"cursor": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"ref": "chat.bsky.actor.defs#profileViewBasic",
"type": "ref"
}
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"required": [
"convoId"
],
"properties": {
"limit": {
"type": "integer",
"default": 50,
"maximum": 100,
"minimum": 1
},
"cursor": {
"type": "string"
},
"convoId": {
"type": "string"
}
}
},
"description": "Returns a paginated list of members from a conversation, for moderation purposes. Does not require the requester to be a member of the conversation."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,45 @@
{
"id": "chat.bsky.moderation.getConvos",
"defs": {
"main": {
"type": "query",
"output": {
"schema": {
"type": "object",
"required": [
"convos"
],
"properties": {
"convos": {
"type": "array",
"items": {
"ref": "chat.bsky.moderation.defs#convoView",
"type": "ref"
}
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"required": [
"convoIds"
],
"properties": {
"convoIds": {
"type": "array",
"items": {
"type": "string"
},
"maxLength": 100,
"minLength": 1
}
}
},
"description": "Gets existing conversations by their IDs, for moderation purposes. Does not require the requester to be a member of the conversations. Unknown IDs are silently omitted from the response."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,63 @@
{
"id": "chat.bsky.moderation.getMessageContext",
"defs": {
"main": {
"type": "query",
"output": {
"schema": {
"type": "object",
"required": [
"messages"
],
"properties": {
"messages": {
"type": "array",
"items": {
"refs": [
"chat.bsky.convo.defs#messageView",
"chat.bsky.convo.defs#systemMessageView"
],
"type": "union"
}
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"required": [
"messageId"
],
"properties": {
"after": {
"type": "integer",
"default": 5,
"description": "Number of user messages after the target to include. System messages between the target and the latest returned user message are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages after the target, up to `maxInterleavedSystemMessages` system messages immediately following the target are returned instead."
},
"before": {
"type": "integer",
"default": 5,
"description": "Number of user messages before the target to include. System messages between the earliest returned user message and the target are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages before the target, up to `maxInterleavedSystemMessages` system messages immediately preceding the target are returned instead."
},
"convoId": {
"type": "string",
"description": "Conversation that the message is from. NOTE: this field will eventually be required."
},
"messageId": {
"type": "string"
},
"maxInterleavedSystemMessages": {
"type": "integer",
"default": 10,
"maximum": 1000,
"minimum": 0,
"description": "Maximum number of system messages to include per gap between consecutive returned messages (and per side when there are no user messages on that side). Within a gap, the system messages closest to the earlier message are kept."
}
}
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,675 @@
{
"id": "chat.bsky.moderation.subscribeModEvents",
"defs": {
"main": {
"type": "subscription",
"errors": [
{
"name": "FutureCursor"
},
{
"name": "ConsumerTooSlow",
"description": "If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."
}
],
"message": {
"schema": {
"refs": [
"#eventConvoFirstMessage",
"#eventGroupChatCreated",
"#eventGroupChatMemberAdded",
"#eventGroupChatMemberJoined",
"#eventGroupChatJoinRequest",
"#eventGroupChatJoinRequestApproved",
"#eventGroupChatJoinRequestRejected",
"#eventChatAccepted",
"#eventGroupChatMemberLeft",
"#eventGroupChatUpdated",
"#eventRateLimitExceeded"
],
"type": "union"
}
},
"parameters": {
"type": "params",
"properties": {
"cursor": {
"type": "string",
"description": "The last known event seq number to backfill from. Use '2222222222222' to backfill from the beginning. Don't specify a cursor to listen only for new events."
}
}
},
"description": "Subscribe to stream of chat events targeted to moderation. Private endpoint."
},
"eventChatAccepted": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"method",
"rev"
],
"properties": {
"rev": {
"type": "string"
},
"method": {
"type": "string",
"description": "How the convo was accepted.",
"knownValues": [
"explicit",
"message"
]
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the person accepting the convo."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner. Only present for group convos."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string",
"description": "The name of the group chat. Only present for group convos."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the convo was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event. Only present for group convos."
}
},
"description": "Fired when a user accepts a chat convo, either explicitly or by sending a message."
},
"eventGroupChatCreated": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"initialMemberDids",
"ownerDid",
"rev"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the actor performing the action. For this event, same as ownerDid."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string",
"description": "The name set at creation time."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
},
"initialMemberDids": {
"type": "array",
"items": {
"type": "string",
"format": "did"
},
"description": "DIDs of everyone added at creation time."
}
},
"description": "Fire when a group chat is created."
},
"eventGroupChatUpdated": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"updateType"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"newName": {
"type": "string",
"description": "The new group name. Only present when updateType is 'name_changed'."
},
"oldName": {
"type": "string",
"description": "The previous group name. Only present when updateType is 'name_changed'."
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the actor performing the action (the owner)."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string",
"description": "Current group name."
},
"lockReason": {
"type": "string",
"description": "Why the group was locked. Only present when updateType is 'locked'.",
"knownValues": [
"owner_action",
"owner_left",
"owner_deactivated",
"owner_deleted",
"owner_suspended",
"owner_taken_down",
"label_applied",
"convo_taken_down"
]
},
"updateType": {
"type": "string",
"description": "What changed.",
"knownValues": [
"name_changed",
"locked",
"locked_permanently",
"unlocked",
"join_link_created",
"join_link_disabled",
"join_link_settings_changed"
]
},
"joinLinkCode": {
"type": "string",
"description": "The code of the join link. Only present when updateType is join-link-related."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
},
"joinLinkFollowersOnly": {
"type": "boolean",
"description": "Whether the join link is restricted to followers of the owner. Only present when updateType is join-link-related."
},
"joinLinkRequiresApproval": {
"type": "boolean",
"description": "Whether the join link requires owner approval to join. Only present when updateType is join-link-related."
}
},
"description": "Fired when a group chat's metadata or status changes."
},
"eventConvoFirstMessage": {
"type": "object",
"required": [
"createdAt",
"rev",
"convoId",
"user",
"recipients"
],
"properties": {
"rev": {
"type": "string"
},
"user": {
"type": "string",
"format": "did",
"description": "The DID of the message author."
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"messageId": {
"type": "string"
},
"recipients": {
"type": "array",
"items": {
"type": "string",
"format": "did"
},
"description": "The list of DIDs message recipients. Does not include the sender, which is in the `user` field"
}
},
"description": "Fired when the first message was sent on a convo."
},
"eventRateLimitExceeded": {
"type": "object",
"required": [
"actorDid",
"createdAt",
"endpoint",
"rev"
],
"properties": {
"rev": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the user who hit the rate limit."
},
"endpoint": {
"type": "string",
"description": "The NSID of the endpoint that was rate limited."
},
"createdAt": {
"type": "string",
"format": "datetime"
}
},
"description": "Fired when a user exceeds a rate limit."
},
"eventGroupChatMemberLeft": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"leaveMethod",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the actor. For voluntary: the person leaving. For kicked: the owner."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"subjectDid": {
"type": "string",
"format": "did",
"description": "The DID of the member who left or was removed."
},
"leaveMethod": {
"type": "string",
"description": "How the member left.",
"knownValues": [
"voluntary",
"kicked"
]
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
}
},
"description": "Fired when a member leaves or is removed from a group chat."
},
"eventGroupChatJoinRequest": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"joinLinkCode",
"ownerDid",
"rev",
"subjectFollowsOwner"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the person requesting to join."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"joinLinkCode": {
"type": "string",
"description": "The code of the join link used to request joining."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
},
"subjectFollowsOwner": {
"type": "boolean",
"description": "Whether the requesting member follows the group owner."
}
},
"description": "Fired when a user requests to join a group chat via an join link that requires approval."
},
"eventGroupChatMemberAdded": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"requestMembersCount",
"rev",
"subjectDid",
"subjectFollowsOwner"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the actor performing the action. For this event, same as ownerDid."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"subjectDid": {
"type": "string",
"format": "did",
"description": "The DID of the member who was added."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
},
"requestMembersCount": {
"type": "integer",
"description": "The number of members who have not yet accepted the convo."
},
"subjectFollowsOwner": {
"type": "boolean",
"description": "Whether the added member follows the group owner."
}
},
"description": "Fired when a member is added to a group chat. Note that members are added in the 'request' state."
},
"eventGroupChatMemberJoined": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"joinLinkCode",
"ownerDid",
"rev",
"subjectFollowsOwner"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the person joining."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"joinLinkCode": {
"type": "string",
"description": "The code of the join link used to join."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
},
"subjectFollowsOwner": {
"type": "boolean",
"description": "Whether the joining member follows the group owner."
}
},
"description": "Fired when a member joins a group chat via an join link that does not require approval."
},
"eventGroupChatJoinRequestApproved": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the owner approving the request."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"subjectDid": {
"type": "string",
"format": "did",
"description": "The DID of the member whose request was approved."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
}
},
"description": "Fired when a join request is approved by the group owner."
},
"eventGroupChatJoinRequestRejected": {
"type": "object",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"rev": {
"type": "string"
},
"convoId": {
"type": "string"
},
"actorDid": {
"type": "string",
"format": "did",
"description": "The DID of the owner rejecting the request."
},
"ownerDid": {
"type": "string",
"format": "did",
"description": "The DID of the group chat owner."
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupName": {
"type": "string"
},
"subjectDid": {
"type": "string",
"format": "did",
"description": "The DID of the member whose request was rejected."
},
"convoCreatedAt": {
"type": "string",
"format": "datetime",
"description": "When the group was originally created."
},
"groupMemberCount": {
"type": "integer",
"description": "Current member count at the time of the event."
}
},
"description": "Fired when a join request is rejected by the group owner."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,32 @@
{
"id": "chat.bsky.moderation.updateActorAccess",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"actor",
"allowAccess"
],
"properties": {
"ref": {
"type": "string"
},
"actor": {
"type": "string",
"format": "did"
},
"allowAccess": {
"type": "boolean"
}
}
},
"encoding": "application/json"
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}