{
  "lexicon": 1,
  "id": "space.polymodel.library.defs",
  "defs": {
    "actor": {
      "type": "object",
      "required": [
        "did",
        "handle"
      ],
      "properties": {
        "avatar": {
          "type": "string",
          "description": "Avatar image URL resolved by the app view (CDN).",
          "format": "uri"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "type": "string",
          "format": "did"
        },
        "displayName": {
          "type": "string"
        },
        "followerCount": {
          "type": "integer"
        },
        "followingCount": {
          "type": "integer"
        },
        "handle": {
          "type": "string",
          "format": "handle"
        },
        "pronouns": {
          "type": "string",
          "description": "Hydrated profile pronouns for bylines and cards."
        },
        "thingCount": {
          "type": "integer",
          "description": "Count of published Polymodel things by this actor."
        },
        "viewer": {
          "type": "ref",
          "ref": "#actorViewerState"
        }
      }
    },
    "actorViewDetailed": {
      "type": "object",
      "description": "Detailed hydrated actor/profile view for profile surfaces, modeled after app.bsky.actor profile view splits.",
      "required": [
        "did",
        "handle",
        "record",
        "indexedAt",
        "viewer"
      ],
      "properties": {
        "avatar": {
          "type": "string",
          "description": "Avatar image URL resolved by the app view (CDN).",
          "format": "uri"
        },
        "defaultLicense": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "type": "string",
          "format": "did"
        },
        "displayName": {
          "type": "string"
        },
        "followerCount": {
          "type": "integer"
        },
        "followingCount": {
          "type": "integer"
        },
        "handle": {
          "type": "string",
          "format": "handle"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "links": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "printers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "pronouns": {
          "type": "string"
        },
        "record": {
          "type": "unknown"
        },
        "thingCount": {
          "type": "integer",
          "description": "Count of published Polymodel things by this actor."
        },
        "viewer": {
          "type": "ref",
          "ref": "#actorViewerState"
        }
      }
    },
    "actorViewerState": {
      "type": "object",
      "description": "Viewer-specific relationship state for an actor/profile.",
      "properties": {
        "blockedBy": {
          "type": "boolean"
        },
        "blocking": {
          "type": "string",
          "description": "Block record URI if the requester blocks this actor.",
          "format": "at-uri"
        },
        "followedBy": {
          "type": "string",
          "description": "Follow record URI if this actor follows the requester.",
          "format": "at-uri"
        },
        "following": {
          "type": "string",
          "description": "Follow record URI if the requester follows this actor.",
          "format": "at-uri"
        },
        "muted": {
          "type": "boolean"
        }
      }
    },
    "aspectRatio": {
      "type": "object",
      "description": "Width:height aspect ratio of an image, for layout before the blob loads.",
      "required": [
        "width",
        "height"
      ],
      "properties": {
        "height": {
          "type": "integer"
        },
        "width": {
          "type": "integer"
        }
      }
    },
    "bbox": {
      "type": "object",
      "description": "Axis-aligned bounding-box dimensions. ATProto has no float type, so x/y/z are decimal strings (e.g. 12.5) parsed to floats internally.",
      "required": [
        "x",
        "y",
        "z"
      ],
      "properties": {
        "unit": {
          "type": "string"
        },
        "x": {
          "type": "string"
        },
        "y": {
          "type": "string"
        },
        "z": {
          "type": "string"
        }
      }
    },
    "chunk": {
      "type": "object",
      "required": [
        "blob",
        "offset",
        "size"
      ],
      "properties": {
        "blob": {
          "type": "blob",
          "accept": [
            "model/stl",
            "model/3mf",
            "model/obj",
            "application/octet-stream",
            "model/step",
            "application/step"
          ],
          "maxSize": 104857600
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "size": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "feedItem": {
      "type": "object",
      "required": [
        "thing"
      ],
      "properties": {
        "thing": {
          "type": "ref",
          "ref": "#thingViewBasic"
        }
      }
    },
    "feedView": {
      "type": "object",
      "required": [
        "items"
      ],
      "properties": {
        "cursor": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#feedItem"
          }
        }
      }
    },
    "file": {
      "type": "object",
      "description": "Chunk-capable geometry manifest. Reassemble by concatenating chunks in offset order. Per-chunk integrity is the blob CID; offset+size make ordering explicit; digest verifies the fully reassembled file.",
      "required": [
        "mimeType",
        "size",
        "chunks"
      ],
      "properties": {
        "chunks": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#chunk"
          },
          "maxLength": 4096
        },
        "digest": {
          "type": "bytes",
          "description": "sha256 digest of the fully reassembled file"
        },
        "mimeType": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "description": "size in bytes of the fully reassembled file"
        }
      }
    },
    "image": {
      "type": "object",
      "description": "An authored image: a blob plus alt text and aspect ratio. Stored on records; the app view resolves it to #imageView.",
      "required": [
        "image",
        "alt",
        "aspectRatio"
      ],
      "properties": {
        "alt": {
          "type": "string",
          "description": "Alt text describing the image, for accessibility.",
          "maxLength": 2000,
          "maxGraphemes": 300
        },
        "aspectRatio": {
          "type": "ref",
          "ref": "#aspectRatio"
        },
        "image": {
          "type": "blob",
          "accept": [
            "image/png",
            "image/jpeg",
            "image/webp"
          ],
          "maxSize": 5242880
        }
      }
    },
    "imageView": {
      "type": "object",
      "description": "A resolved image view: CDN URLs for thumbnail and full size plus aspect ratio. Currently resolved via Bluesky's CDN by the app view.",
      "required": [
        "thumb",
        "fullsize"
      ],
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "type": "ref",
          "ref": "#aspectRatio"
        },
        "fullsize": {
          "type": "string",
          "description": "Fully-qualified full-size URL (CDN, resolved by the app view).",
          "format": "uri"
        },
        "thumb": {
          "type": "string",
          "description": "Fully-qualified thumbnail URL (CDN, resolved by the app view).",
          "format": "uri"
        }
      }
    },
    "modelView": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "author",
        "record",
        "indexedAt",
        "name",
        "partCount",
        "viewer"
      ],
      "properties": {
        "author": {
          "type": "ref",
          "ref": "#actor"
        },
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "cover": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "name": {
          "type": "string"
        },
        "partCount": {
          "type": "integer"
        },
        "previews": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "record": {
          "type": "unknown"
        },
        "summary": {
          "type": "string"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "viewer": {
          "type": "ref",
          "ref": "#viewerState"
        }
      }
    },
    "partView": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "author",
        "record",
        "indexedAt",
        "name",
        "file",
        "viewer"
      ],
      "properties": {
        "author": {
          "type": "ref",
          "ref": "#actor"
        },
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "file": {
          "type": "ref",
          "ref": "#file"
        },
        "format": {
          "type": "string"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "name": {
          "type": "string"
        },
        "previews": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "record": {
          "type": "unknown"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "viewer": {
          "type": "ref",
          "ref": "#viewerState"
        }
      }
    },
    "thingView": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "author",
        "record",
        "indexedAt",
        "name",
        "license",
        "likeCount",
        "saveCount",
        "modelCount",
        "partCount",
        "viewer"
      ],
      "properties": {
        "author": {
          "type": "ref",
          "ref": "#actor"
        },
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "cover": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "derivedFrom": {
          "type": "ref",
          "ref": "com.atproto.repo.strongRef"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "intendedToWorkWith": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "com.atproto.repo.strongRef"
          }
        },
        "license": {
          "type": "string"
        },
        "likeCount": {
          "type": "integer"
        },
        "modelCount": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "partCount": {
          "type": "integer",
          "description": "Thing-level aggregate count of parts across included models, computed by the app view."
        },
        "previews": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "record": {
          "type": "unknown"
        },
        "saveCount": {
          "type": "integer"
        },
        "summary": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "description": "Hydrated display tags, including appview-aggregated external tag assertions.",
          "items": {
            "type": "string"
          }
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "viewer": {
          "type": "ref",
          "ref": "#viewerState"
        }
      }
    },
    "thingViewBasic": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "author",
        "name",
        "likeCount",
        "saveCount",
        "modelCount",
        "partCount",
        "indexedAt",
        "viewer"
      ],
      "properties": {
        "author": {
          "type": "ref",
          "ref": "#actor"
        },
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "cover": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "likeCount": {
          "type": "integer"
        },
        "modelCount": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "partCount": {
          "type": "integer",
          "description": "Thing-level aggregate count of parts across included models, computed by the app view."
        },
        "previews": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#imageView"
          }
        },
        "saveCount": {
          "type": "integer"
        },
        "tags": {
          "type": "array",
          "description": "Hydrated display tags for browse/search/profile cards, including appview-aggregated external tag assertions.",
          "items": {
            "type": "string"
          }
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "viewer": {
          "type": "ref",
          "ref": "#viewerState"
        }
      }
    },
    "viewerState": {
      "type": "object",
      "properties": {
        "like": {
          "type": "string",
          "format": "at-uri"
        },
        "save": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "workMeta": {
      "type": "object",
      "description": "Reference-only shared field set; fields are inlined on thing/model.",
      "properties": {
        "cover": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#image"
          }
        },
        "derivedFrom": {
          "type": "ref",
          "ref": "com.atproto.repo.strongRef"
        },
        "instructions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "intendedToWorkWith": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "com.atproto.repo.strongRef"
          }
        },
        "license": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "previews": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#image"
          }
        },
        "summary": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}