{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "file": {
      "properties": {
        "content": {
          "accept": [
            "*/*"
          ],
          "maxSize": 5000000,
          "type": "blob"
        },
        "executable": {
          "type": "boolean"
        },
        "path": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "content"
      ],
      "type": "object"
    },
    "gitBase": {
      "description": "A git commit the files apply on top of. The repo is a tangled repo DID; its DID document's #tangled_knot service names the knot that hosts the git data.",
      "properties": {
        "commit": {
          "description": "Hex object id of the base commit.",
          "maxLength": 64,
          "minLength": 40,
          "type": "string"
        },
        "path": {
          "description": "Subdirectory of the repo the project is rooted at, '/'-separated and relative to the repo root. The rest of the repo is left untouched by a push.",
          "maxLength": 1024,
          "type": "string"
        },
        "ref": {
          "description": "Branch the project tracks, without refs/heads/.",
          "maxLength": 256,
          "type": "string"
        },
        "repo": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "repo",
        "commit"
      ],
      "type": "object"
    },
    "main": {
      "key": "tid",
      "record": {
        "properties": {
          "base": {
            "ref": "#gitBase",
            "type": "ref"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "description": {
            "description": "Plain text any client can show as is. When richDescription is set, this is its text with the Markdown syntax removed, cut short with '…' if it would not fit.",
            "maxGraphemes": 1000,
            "maxLength": 10000,
            "type": "string"
          },
          "files": {
            "description": "Paths are relative to the project root, use '/', and never start with '/' or contain '.' or '..' segments. Each path appears at most once. With a base, entries override the base tree and #removed entries delete from it.",
            "items": {
              "refs": [
                "#file",
                "#removed"
              ],
              "type": "union"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "forkOf": {
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "name": {
            "maxGraphemes": 100,
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          },
          "preview": {
            "ref": "#preview",
            "type": "ref"
          },
          "richDescription": {
            "closed": false,
            "description": "The description with formatting. nibling writes at.markpub.markdown with renderingRules 'ultramark' and no flavor, since ultramark's subset is neither CommonMark nor GFM exactly. Its text.markdown is at most 30000 bytes and 3000 graphemes. Its text.facets are app.bsky.richtext.facet objects with one #link feature for each link the Markdown renders (http, https, mailto, and at:// targets), byte ranges into text.markdown that include the link's markup. Readers that do not know the variant show description.",
            "refs": [
              "at.markpub.markdown"
            ],
            "type": "union"
          },
          "slug": {
            "description": "The project's name in URLs, such as /@alice.test/bouncing-ball. Lowercase a-z, 0-9, and '-', with no leading, trailing, or doubled '-'. Never a valid TID, so it cannot be mistaken for a record key. Unique among the author's projects; when two records share one, readers resolve it to the older record. The record key stays the stable identity, so renaming changes the slug and never the URI.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "tags": {
            "items": {
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "maxLength": 8,
            "type": "array"
          },
          "thumbnail": {
            "accept": [
              "image/png",
              "image/jpeg",
              "image/webp"
            ],
            "maxSize": 1000000,
            "type": "blob"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "name",
          "files",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "preview": {
      "description": "How the sandbox runs the project.",
      "properties": {
        "command": {
          "description": "For command: the shell command that starts a server, such as 'npm run dev'.",
          "maxLength": 1000,
          "type": "string"
        },
        "entry": {
          "description": "For static: the HTML file to open. Defaults to index.html.",
          "maxLength": 1024,
          "type": "string"
        },
        "install": {
          "description": "Run npm install before the command.",
          "type": "boolean"
        },
        "kind": {
          "knownValues": [
            "static",
            "command"
          ],
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "removed": {
      "description": "Deletes a path that the base tree has.",
      "properties": {
        "path": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path"
      ],
      "type": "object"
    }
  },
  "description": "A project: a tree of files, how to preview it, and where it came from.",
  "id": "dev.nibling.project",
  "lexicon": 1
}
