{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://boriken-dev.github.io/agent-overlay-spec/schemas/overlay.schema.json",
  "title": "AOS overlay.cfg data model",
  "description": "The value an overlay.cfg reads as, in any format (TOML, JSON, YAML). Reading rules, integer-versus-float, cross references and file existence are checked semantically, as the specification states.",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "description": { "type": "string" },
    "requires": { "type": "array", "items": { "$ref": "#/$defs/overlayName" } },
    "routing": { "type": "array", "items": { "type": "string" } },
    "rules": { "description": "Added after the rules default (every rules/<name>.md); an entry naming the same file replaces that default entry.", "type": "array", "items": { "$ref": "#/$defs/relPath" } },
    "priority": { "type": "integer" },
    "defaults": { "$ref": "#/$defs/defaults" },
    "context": { "description": "Added after the context default (the root CONTEXT.md); an entry naming the same file replaces that default entry.", "type": "array", "items": { "$ref": "#/$defs/relPath" } },
    "skills": { "description": "Added to the skills default (every skills/<name>/SKILL.md). A name with no such file is resolved through the consumer's catalogs; a table names where to fetch it.", "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/skillEntry" } },
    "options": { "$ref": "#/$defs/options" },
    "env": { "$ref": "#/$defs/envMap" },
    "env_files": { "description": "Added after the env default (the root file env, read as dotenv); an entry naming env replaces that default entry.", "type": "array", "items": { "$ref": "#/$defs/envFile" } },
    "paths": { "description": "Added after the bin (bin/ to PATH) and lib (lib/python/ to PYTHONPATH) defaults; an entry naming the same directory replaces that default entry.", "type": "array", "items": { "$ref": "#/$defs/pathAddition" } },
    "env_scripts": { "description": "Run after the env_scripts default (one root env.<ext>); an entry naming a root env.<ext> configures that file in the default choice.", "type": "array", "items": { "$ref": "#/$defs/envScript" } },
    "runtime": { "$ref": "#/$defs/runtime" },
    "setup": { "description": "Variants tried before the setup default (one root setup.<ext>); an entry naming a root setup.<ext> configures that file in the default choice.", "type": "array", "items": { "$ref": "#/$defs/setupVariant" } },
    "scripts": { "$ref": "#/$defs/scripts" },
    "mcp": { "$ref": "#/$defs/mcp" },
    "hooks": { "$ref": "#/$defs/hooks" },
    "harness": { "$ref": "#/$defs/harness" },
    "knowledge": { "$ref": "#/$defs/knowledge" },
    "about": { "$ref": "#/$defs/about" }
  },
  "additionalProperties": { "$ref": "#/$defs/value" },
  "$defs": {
    "defaults": {
      "description": "Turns off a default: false turns that one off; true, the default, keeps it.",
      "type": "object",
      "properties": {
        "bin": { "type": "boolean" },
        "lib": { "type": "boolean" },
        "env": { "type": "boolean" },
        "env_scripts": { "type": "boolean" },
        "setup": { "type": "boolean" },
        "deps": { "type": "boolean" },
        "context": { "type": "boolean" },
        "skills": { "type": "boolean" },
        "rules": { "type": "boolean" },
        "hooks": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "value": {
      "description": "Any data model value: no null anywhere.",
      "type": ["string", "number", "boolean", "array", "object"],
      "items": { "$ref": "#/$defs/value" },
      "additionalProperties": { "$ref": "#/$defs/value" }
    },
    "relPath": {
      "description": "A /-separated path under the overlay root, as the manifest section defines it: no empty component, none ending in '.' or a space, no character Windows refuses or Unicode ignores, no excluded or device name in any case, no '.pyc' entry, no '~' followed by a digit.",
      "type": "string",
      "allOf": [
        { "pattern": "^[^/\\\\:*?\"<>|\\x00-\\x1f\\x7f-\\x9f\\u200c-\\u200f\\u202a-\\u202e\\u2066-\\u206f\\ufeff]*[^/\\\\:*?\"<>|\\x00-\\x1f\\x7f-\\x9f\\u200c-\\u200f\\u202a-\\u202e\\u2066-\\u206f\\ufeff. ](?:/[^/\\\\:*?\"<>|\\x00-\\x1f\\x7f-\\x9f\\u200c-\\u200f\\u202a-\\u202e\\u2066-\\u206f\\ufeff]*[^/\\\\:*?\"<>|\\x00-\\x1f\\x7f-\\x9f\\u200c-\\u200f\\u202a-\\u202e\\u2066-\\u206f\\ufeff. ])*$" },
        { "not": { "pattern": "(?:^|/)(?:(?:\\.[Gg][Ii][Tt]|\\.[Hh][Gg]|\\.[Ss][Vv][Nn]|__[Pp][Yy][Cc][Aa][Cc][Hh][Ee]__|\\.[Mm][Yy][Pp][Yy]_[Cc][Aa][Cc][Hh][Ee]|\\.[Pp][Yy][Tt][Ee][Ss][Tt]_[Cc][Aa][Cc][Hh][Ee]|\\.[Rr][Uu][Ff][Ff]_[Cc][Aa][Cc][Hh][Ee]|\\.[Tt][Oo][Xx]|\\.[Vv][Ee][Nn][Vv]|[Nn][Oo][Dd][Ee]_[Mm][Oo][Dd][Uu][Ll][Ee][Ss])(?:/|$)|(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Nn][Ii][Nn]\\$|[Cc][Oo][Nn][Oo][Uu][Tt]\\$|(?:[Cc][Oo][Mm]|[Ll][Pp][Tt])[0-9¹²³])(?:\\.[^/]*)?(?:/|$)|[^/]*\\.[Pp][Yy][Cc](?:/|$))|~[0-9]" } }
      ]
    },
    "overlayName": { "type": "string", "pattern": "^[A-Za-z](?:[A-Za-z0-9_.-]*[A-Za-z0-9])?$" },
    "toolName": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$" },
    "skillEntry": {
      "description": "A skill's name, bundled or for the consumer's catalogs to resolve, or a table naming its source.",
      "oneOf": [
        { "$ref": "#/$defs/toolName" },
        {
          "type": "object",
          "required": ["name", "source"],
          "properties": {
            "name": { "$ref": "#/$defs/toolName" },
            "source": { "$ref": "#/$defs/sourceString" },
            "ref": { "$ref": "#/$defs/gitRef" },
            "pin": { "$ref": "#/$defs/digest" }
          },
          "additionalProperties": false
        }
      ]
    },
    "envName": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
    "osName": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
    "osList": { "type": "array", "items": { "$ref": "#/$defs/osName" } },
    "interpreter": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
    "harnessId": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
    "digest": { "type": "string", "pattern": "^sha256:[0-9a-fA-F]{64}$" },
    "timeout": { "type": "integer", "minimum": 0, "maximum": 2147483647 },
    "text": { "type": "string", "pattern": "^[^\\x00]*$" },
    "variable": {
      "allOf": [
        { "$ref": "#/$defs/envName" },
        { "not": { "pattern": "^(?:[Aa][Oo][Ss]_.*|.*_[Oo][Vv][Ee][Rr][Ll][Aa][Yy]_(?:[Rr][Oo][Oo][Tt]|[Ss][Tt][Aa][Tt][Ee]))$" } }
      ]
    },
    "envValue": {
      "description": "Text (a string, or value) has its ${NAME} placeholders substituted when the variable is set, against the environment built so far; $$ is a $. A path and a secret reference are never substituted.",
      "oneOf": [
        { "$ref": "#/$defs/text" },
        {
          "type": "object",
          "required": ["value"],
          "properties": { "value": { "$ref": "#/$defs/text" }, "if_unset": { "type": "boolean" } },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": ["path"],
          "properties": { "path": { "$ref": "#/$defs/relPath" }, "if_unset": { "type": "boolean" } },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": ["secret"],
          "properties": {
            "secret": { "type": "string", "minLength": 1 },
            "if_unset": { "type": "boolean" },
            "optional": { "type": "boolean" }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": ["provider", "key"],
          "properties": {
            "provider": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" },
            "key": { "type": "string", "minLength": 1, "pattern": "^[^\\x00]*$" },
            "if_unset": { "type": "boolean" },
            "optional": { "type": "boolean" },
            "value": false,
            "path": false,
            "secret": false
          },
          "allOf": [
            {
              "if": { "properties": { "provider": { "const": "file" } } },
              "then": { "properties": { "key": { "$ref": "#/$defs/relPath" } } }
            },
            {
              "if": { "properties": { "provider": { "const": "env" } } },
              "then": { "properties": { "key": { "$ref": "#/$defs/envName" } } }
            }
          ],
          "additionalProperties": { "type": ["string", "integer", "boolean"] }
        }
      ]
    },
    "options": {
      "description": "Settings the overlay declares for its context and skill bodies to read as ${name}. The value is the user's, kept in the consumer's own configuration, never in the overlay.",
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/variable" },
      "additionalProperties": { "$ref": "#/$defs/option" }
    },
    "option": {
      "type": "object",
      "required": ["type"],
      "properties": {
        "type": { "enum": ["string", "integer", "boolean"] },
        "default": { "description": "Of the declared type; a sensitive option has none.", "type": ["string", "integer", "boolean"] },
        "sensitive": { "type": "boolean" },
        "description": { "type": "string" }
      },
      "additionalProperties": false
    },
    "envMap": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/variable" },
      "additionalProperties": { "$ref": "#/$defs/envValue" }
    },
    "envFile": {
      "oneOf": [
        { "$ref": "#/$defs/relPath" },
        {
          "type": "object",
          "required": ["path"],
          "properties": {
            "path": { "$ref": "#/$defs/relPath" },
            "format": { "enum": ["aos", "dotenv"] },
            "os": { "$ref": "#/$defs/osList" }
          },
          "additionalProperties": false
        }
      ]
    },
    "pathAddition": {
      "type": "object",
      "required": ["variable", "path"],
      "properties": {
        "variable": { "$ref": "#/$defs/variable" },
        "path": { "$ref": "#/$defs/relPath" },
        "position": { "enum": ["prepend", "append"] },
        "os": { "$ref": "#/$defs/osList" }
      },
      "additionalProperties": false
    },
    "envScript": {
      "type": "object",
      "required": ["interpreter", "path"],
      "properties": {
        "interpreter": { "$ref": "#/$defs/interpreter" },
        "path": { "$ref": "#/$defs/relPath" },
        "args": { "type": "array", "items": { "$ref": "#/$defs/text" } },
        "timeout": { "$ref": "#/$defs/timeout" },
        "os": { "$ref": "#/$defs/osList" }
      },
      "additionalProperties": false
    },
    "setupVariant": {
      "description": "Runs with the phase (install, sync or remove) as its first argument, before args, and in AOS_SETUP_PHASE.",
      "type": "object",
      "required": ["interpreter", "path"],
      "properties": {
        "interpreter": { "$ref": "#/$defs/interpreter" },
        "path": { "$ref": "#/$defs/relPath" },
        "args": { "type": "array", "items": { "$ref": "#/$defs/text" } },
        "timeout": { "$ref": "#/$defs/timeout" },
        "network": { "type": "boolean" },
        "os": { "$ref": "#/$defs/osList" }
      },
      "additionalProperties": false
    },
    "hookRun": {
      "description": "A script a hook runs; its interpreter follows from its extension, as a scripts path's does.",
      "allOf": [
        { "$ref": "#/$defs/scriptPath" },
        { "pattern": "\\.(?:py|sh|bash|ps1|js|mjs|cjs)$" }
      ]
    },
    "hookTimeout": { "type": "integer", "minimum": 1, "maximum": 3600 },
    "hookReasons": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "enum": ["new", "resume", "clear", "compact", "fork"] }
    },
    "toolKinds": {
      "description": "Agent Client Protocol tool kinds.",
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "enum": ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "switch_mode", "other"] }
    },
    "hookSets": {
      "description": "The variables a hook's env output may set at this event; any other is a failure.",
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/variable" }
    },
    "hookReport": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "const": "report" }
          },
          "additionalProperties": false
        }
      ],
      "description": "An event no hook can refuse and that takes no variables."
    },
    "hookGuard": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "enum": ["report", "refuse"] }
          },
          "additionalProperties": false
        }
      ],
      "description": "An event a hook can refuse: on_failure = refuse makes a failure refuse it."
    },
    "hookStart": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "match": { "$ref": "#/$defs/hookReasons" },
            "sets": { "$ref": "#/$defs/hookSets" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "enum": ["report", "refuse"] }
          },
          "additionalProperties": false
        }
      ]
    },
    "hookPrompt": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "sets": { "$ref": "#/$defs/hookSets" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "enum": ["report", "refuse"] }
          },
          "additionalProperties": false
        }
      ]
    },
    "hookCd": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "sets": { "$ref": "#/$defs/hookSets" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "const": "report" }
          },
          "additionalProperties": false
        }
      ]
    },
    "hookBeforeTool": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "match": { "$ref": "#/$defs/toolKinds" },
            "sets": { "$ref": "#/$defs/hookSets" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "enum": ["report", "refuse"] }
          },
          "additionalProperties": false
        }
      ]
    },
    "hookAfterTool": {
      "oneOf": [
        { "const": false },
        { "$ref": "#/$defs/hookRun" },
        {
          "type": "object",
          "properties": {
            "run": { "$ref": "#/$defs/hookRun" },
            "match": { "$ref": "#/$defs/toolKinds" },
            "timeout": { "$ref": "#/$defs/hookTimeout" },
            "on_failure": { "const": "report" }
          },
          "additionalProperties": false
        }
      ]
    },
    "hooks": {
      "description": "What runs at each event: a script, a table (no run: hook.<ext>, chosen by runtime), or false for nothing. An event named here replaces its default entry.",
      "type": "object",
      "properties": {
        "pre-env": { "$ref": "#/$defs/hookGuard" },
        "session-start": { "$ref": "#/$defs/hookStart" },
        "session-end": { "$ref": "#/$defs/hookReport" },
        "prompt": { "$ref": "#/$defs/hookPrompt" },
        "turn-end": { "$ref": "#/$defs/hookReport" },
        "cd": { "$ref": "#/$defs/hookCd" },
        "pre-compact": { "$ref": "#/$defs/hookGuard" },
        "pre-tool": { "$ref": "#/$defs/hookBeforeTool" },
        "post-tool": { "$ref": "#/$defs/hookAfterTool" }
      },
      "additionalProperties": false
    },
    "version": { "type": "string", "pattern": "^[0-9]{1,9}(?:\\.[0-9]{1,9}){0,2}$" },
    "environmentName": {
      "description": "shared (the default): the consumer's environment for the runtime in this scope; isolated: this overlay's own; any other name: shared by the overlays that choose it.",
      "type": "string",
      "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9_.-]*[A-Za-z0-9])?$"
    },
    "pythonVariant": {
      "type": "object",
      "properties": {
        "version": { "$ref": "#/$defs/version" },
        "requirements": { "$ref": "#/$defs/relPath" },
        "lock": { "$ref": "#/$defs/relPath" },
        "lock_digest": { "$ref": "#/$defs/digest" },
        "environment": { "$ref": "#/$defs/environmentName" },
        "os": { "$ref": "#/$defs/osList" }
      },
      "not": { "required": ["requirements", "lock"] },
      "dependentRequired": { "lock_digest": ["lock"] },
      "additionalProperties": false
    },
    "nodeVariant": {
      "type": "object",
      "properties": {
        "version": { "$ref": "#/$defs/version" },
        "package": {
          "description": "A package.json; a package-lock.json beside it pins what is installed.",
          "allOf": [{ "$ref": "#/$defs/relPath" }, { "pattern": "(?:^|/)package\\.json$" }]
        },
        "environment": { "$ref": "#/$defs/environmentName" },
        "os": { "$ref": "#/$defs/osList" }
      },
      "additionalProperties": false
    },
    "runtime": {
      "type": "object",
      "properties": {
        "os": { "$ref": "#/$defs/osList" },
        "commands": {
          "type": "array",
          "items": {
            "oneOf": [
              { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]*$" },
              {
                "type": "object",
                "required": ["name"],
                "properties": {
                  "name": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]*$" },
                  "os": { "$ref": "#/$defs/osList" }
                },
                "additionalProperties": false
              }
            ]
          }
        },
        "python": { "type": "array", "items": { "$ref": "#/$defs/pythonVariant" } },
        "node": { "type": "array", "items": { "$ref": "#/$defs/nodeVariant" } }
      },
      "additionalProperties": false
    },
    "scriptPath": {
      "type": "string",
      "allOf": [
        { "pattern": "^[A-Za-z0-9_+-][A-Za-z0-9._+-]*(?:/[A-Za-z0-9_+-][A-Za-z0-9._+-]*)*$" },
        { "$ref": "#/$defs/relPath" }
      ]
    },
    "scripts": {
      "type": "object",
      "propertyNames": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$", "not": { "pattern": "\\.[eE][xX][eE]$" } },
      "additionalProperties": {
        "oneOf": [
          { "const": false },
          {
            "allOf": [
              { "$ref": "#/$defs/scriptPath" },
              { "pattern": "\\.(?:py|sh|bash|ps1|js|mjs|cjs)$" }
            ]
          },
          {
            "type": "object",
            "required": ["path", "interpreter"],
            "properties": {
              "path": { "$ref": "#/$defs/scriptPath" },
              "interpreter": { "$ref": "#/$defs/interpreter" },
              "os": { "$ref": "#/$defs/osList" }
            },
            "additionalProperties": false
          }
        ]
      }
    },
    "knowledge": {
      "description": "A hint that the overlay's knowledge is meant to be served through the knowledge tools rather than put in the context.",
      "type": "object",
      "properties": { "serve": { "type": "boolean" } },
      "additionalProperties": false
    },
    "harness": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/harnessId" },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "context": { "type": "array", "items": { "$ref": "#/$defs/relPath" } },
          "skills": { "type": "boolean" },
          "model": { "type": "string", "minLength": 1 },
          "effort": { "type": "string", "minLength": 1 },
          "delegate": {
            "description": "A suggested delegation default; it only chooses among what the consumer allows.",
            "type": "object",
            "properties": {
              "default": { "type": "string", "minLength": 1 },
              "sources": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
              "max_running": { "type": "integer", "minimum": 0, "maximum": 2147483647 }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": { "$ref": "#/$defs/value" }
      }
    },
    "server": {
      "type": "object",
      "required": ["name", "transport"],
      "properties": {
        "name": { "$ref": "#/$defs/toolName" },
        "transport": { "enum": ["stdio", "streamable-http"] },
        "timeout": { "type": "number", "minimum": 0.001, "maximum": 2147483647 },
        "command": { "type": "string", "minLength": 1, "pattern": "^[^\\x00]*$" },
        "args": { "type": "array", "items": { "$ref": "#/$defs/text" } },
        "env": { "$ref": "#/$defs/envMap" },
        "env_passthrough": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/envName" } },
        "url": { "type": "string", "format": "uri", "pattern": "^[Hh][Tt][Tt][Pp][Ss]?://[^/?#@\\s]+(?:[/?][^#\\s]*)?$" },
        "headers_env": {
          "type": "object",
          "propertyNames": { "pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$" },
          "additionalProperties": { "$ref": "#/$defs/envName" }
        }
      },
      "allOf": [
        {
          "if": { "properties": { "transport": { "const": "stdio" } }, "required": ["transport"] },
          "then": { "required": ["command"], "not": { "anyOf": [{ "required": ["url"] }, { "required": ["headers_env"] }] } }
        },
        {
          "if": { "properties": { "transport": { "const": "streamable-http" } }, "required": ["transport"] },
          "then": { "required": ["url"], "not": { "anyOf": [{ "required": ["command"] }, { "required": ["args"] }, { "required": ["env"] }, { "required": ["env_passthrough"] }] } }
        }
      ],
      "additionalProperties": false
    },
    "skillLink": {
      "type": "object",
      "required": ["name", "server"],
      "properties": {
        "name": { "$ref": "#/$defs/toolName" },
        "server": { "$ref": "#/$defs/toolName" }
      },
      "additionalProperties": false
    },
    "mcp": {
      "type": "object",
      "properties": {
        "servers": { "type": "array", "items": { "$ref": "#/$defs/server" } },
        "skills": { "type": "array", "items": { "$ref": "#/$defs/skillLink" } }
      },
      "additionalProperties": false
    },
    "line": {
      "description": "One line of display text: not empty, no control character, line or paragraph separator, or bidirectional embedding, override or isolate.",
      "type": "string",
      "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f\\u2028\\u2029\\u202a-\\u202e\\u2066-\\u2069]+$"
    },
    "webUrl": {
      "description": "An https URL with a host and no user information.",
      "type": "string",
      "pattern": "^https://[^\\x00-\\x20\\x7f-\\x9f/?#@\\\\]+(?:[/?#][^\\x00-\\x20\\x7f-\\x9f]*)?$"
    },
    "about": {
      "description": "Store metadata, informational only: a consumer that shows no store never reads it, nothing in it changes composition, activation or the environment, and a problem in it never stops an overlay from applying.",
      "type": "object",
      "properties": {
        "summary": { "$ref": "#/$defs/line" },
        "icon": {
          "description": "A PNG or WebP image: in a manifest a file of the overlay, in a catalog a file beside the catalog. SVG is not an icon format.",
          "allOf": [{ "$ref": "#/$defs/relPath" }, { "pattern": "\\.(?:[Pp][Nn][Gg]|[Ww][Ee][Bb][Pp])$" }]
        },
        "homepage": { "$ref": "#/$defs/webUrl" },
        "repository": { "$ref": "#/$defs/webUrl" },
        "license": { "description": "An SPDX license expression; its grammar is checked semantically.", "type": "string", "pattern": "^[A-Za-z0-9.+:() -]+$" },
        "authors": { "type": "array", "items": { "$ref": "#/$defs/line" } },
        "tags": { "type": "array", "uniqueItems": true, "items": { "type": "string", "maxLength": 32, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" } }
      },
      "additionalProperties": false
    },
    "catalog": {
      "description": "A catalog: the overlays and skills a store lists, by name. Not a manifest: validate a catalog against this definition. Its fields are advertising; what is fetched is authoritative.",
      "type": "object",
      "anyOf": [{ "required": ["overlays"] }, { "required": ["skills"] }],
      "properties": {
        "name": { "$ref": "#/$defs/line" },
        "description": { "type": "string" },
        "homepage": { "$ref": "#/$defs/webUrl" },
        "overlays": {
          "type": "object",
          "propertyNames": { "$ref": "#/$defs/overlayName" },
          "additionalProperties": { "$ref": "#/$defs/catalogEntry" }
        },
        "skills": {
          "type": "object",
          "propertyNames": { "$ref": "#/$defs/toolName" },
          "additionalProperties": { "$ref": "#/$defs/catalogEntry" }
        }
      },
      "additionalProperties": { "$ref": "#/$defs/value" }
    },
    "catalogEntry": {
      "description": "A source string (the minimal form) or a table (the full form).",
      "oneOf": [
        { "$ref": "#/$defs/sourceString" },
        {
          "type": "object",
          "required": ["source"],
          "properties": {
            "source": { "$ref": "#/$defs/sourceString" },
            "ref": { "$ref": "#/$defs/gitRef" },
            "pin": { "$ref": "#/$defs/digest" },
            "description": { "type": "string" },
            "about": { "$ref": "#/$defs/about" }
          },
          "additionalProperties": false
        }
      ]
    },
    "sourceString": { "type": "string", "pattern": "[^ \\t\\r\\n]" },
    "gitRef": { "type": "string", "pattern": "^[^-/:\\\\@#\\x00-\\x20\\x7f][^/:\\\\@#\\x00-\\x20\\x7f]*$" }
  }
}
