{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docspack.dev/schema/v1.json",
  "title": "docspack package manifest",
  "description": "Contents of .llms/manifest.json inside a docspack documentation package.",
  "type": "object",
  "required": [
    "name",
    "version",
    "chunks"
  ],
  "additionalProperties": true,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "description": "npm package name, e.g. @stripe/docspack.",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "description": "Must match the version in package.json.",
      "minLength": 1
    },
    "chunks": {
      "type": "array",
      "description": "Every retrievable unit of documentation in the package.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "file"
        ],
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique within the package; used to build the chunk_id in the index.",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
          },
          "file": {
            "type": "string",
            "description": "Path relative to .llms/. Must not escape that directory.",
            "minLength": 1
          },
          "tokens": {
            "type": "integer",
            "description": "Approximate token count, used to budget a response. Estimated when absent.",
            "minimum": 0
          },
          "tags": {
            "type": "array",
            "description": "Search terms indexed alongside the content.",
            "items": {
              "type": "string"
            }
          },
          "entities": {
            "type": "array",
            "description": "Identifiers the chunk documents, e.g. Stripe.setApiKey.",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
