{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openpresentation.org/schema/opf-icon-set/v1",
  "$comment": "The v1 in the $id is the pre-1.0 line, not a frozen contract: this schema may change in any 0.x minor release. The release that produced this copy is the version of the @openpresentation/opf package it came from (opf --version; opf schemas lists it next to each id). See docs/schema-versioning.md.",
  "title": "Icon Set",
  "description": "Schema for icon-set records: one set of icons that share a viewBox and a style, each icon as SVG path data. An OPF `icon` names one as `<set>:<name>` (docs/icons.md). @openpresentation/gallery ships Lucide and Tabler outline, generated from their npm packages; a host registers them as `galleryIconSets()` of `@openpresentation/gallery/icon-sets` and loads only the icons a deck uses, and a document embeds only the icons it uses under `catalogs.<group>.iconSets.<id>` (a record without `$schema`, `id`, `licenseText` or `tags`).",
  "type": "object",
  "required": ["$schema", "id", "name", "license", "copyright", "viewBox", "style", "icons"],
  "additionalProperties": false,
  "patternProperties": {
    "^x-": { "description": "Publisher extension member, ignored by engines and stripped when a record is embedded." }
  },
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://openpresentation.org/schema/opf-icon-set/v1",
      "description": "Identifies this record as an icon set."
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$",
      "description": "The set's id, the part of an icon reference before the colon. `asset` is not a set id: `asset:<id>` is an asset reference.",
      "not": { "const": "asset" },
      "examples": ["lucide", "tabler"]
    },
    "name": { "type": "string", "description": "Human-readable set name shown in pickers.", "examples": ["Lucide", "Tabler outline"] },
    "summary": { "type": "string", "description": "One line on what the set looks like." },
    "version": { "type": "string", "description": "The version of the source the icons were taken from, such as the npm package version.", "examples": ["1.68.0"] },
    "package": { "type": "string", "description": "The npm package the icons were generated from.", "examples": ["lucide-static", "@tabler/icons"] },
    "homepage": { "type": "string", "format": "uri", "description": "Where the set is published." },
    "license": { "type": "string", "description": "The SPDX license id of the icons.", "examples": ["ISC", "MIT"] },
    "copyright": { "type": "string", "description": "The copyright notice the license asks every copy to keep." },
    "licenseText": { "type": "string", "description": "The full license text, as the source package ships it." },
    "viewBox": {
      "type": "array",
      "description": "The one viewBox every icon of the set is drawn in: min-x, min-y, width, height.",
      "prefixItems": [{ "type": "number" }, { "type": "number" }, { "type": "number", "exclusiveMinimum": 0 }, { "type": "number", "exclusiveMinimum": 0 }],
      "items": false,
      "minItems": 4,
      "examples": [[0, 0, 24, 24]]
    },
    "style": {
      "type": "string",
      "enum": ["stroke", "fill"],
      "description": "How a string icon draws: `stroke` strokes its path at `strokeWidth` with no fill, `fill` fills it (nonzero rule)."
    },
    "strokeWidth": { "type": "number", "exclusiveMinimum": 0, "description": "The stroke width in viewBox units (stroke sets). Default 2." },
    "strokeLinecap": { "type": "string", "enum": ["butt", "round", "square"], "description": "The stroke's line caps. Default round." },
    "strokeLinejoin": { "type": "string", "enum": ["miter", "round", "bevel"], "description": "The stroke's line joins. Default round." },
    "icons": {
      "type": "object",
      "description": "The icons by name. A string is the icon's path data, drawn as `style` says; an object separates the parts a stroke set strokes (`stroke`) from those it fills (`fill`). Every icon is one color: the engines draw it in the accent.",
      "propertyNames": { "pattern": "^[a-z0-9][a-z0-9-]*$" },
      "additionalProperties": {
        "oneOf": [
          { "type": "string", "minLength": 1 },
          {
            "type": "object",
            "additionalProperties": false,
            "minProperties": 1,
            "properties": {
              "stroke": { "type": "string", "minLength": 1 },
              "fill": { "type": "string", "minLength": 1 }
            }
          }
        ]
      }
    },
    "renamed": {
      "type": "object",
      "description": "Former icon names by current name, from the source package's aliases. Only a finding and an icon search read it; an old name is never an icon.",
      "additionalProperties": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }
    },
    "tags": {
      "type": "object",
      "description": "Search keywords by icon name, from the source package: what an icon search (the MCP's search_icons, pptx.gallery) matches besides the name.",
      "additionalProperties": { "type": "array", "items": { "type": "string" } }
    }
  }
}
