{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-harness.local/discover/source-pack.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "entries"],
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "minimum": 1
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "repo"],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "repo": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "kind": {
            "type": "string",
            "enum": [
              "repo",
              "docs",
              "marketplace",
              "registry",
              "package-registry",
              "local-manifest",
              "local-directory"
            ]
          },
          "authorityTier": {
            "type": "string",
            "enum": [
              "trusted-local",
              "official-first-party",
              "official-marketplace",
              "official-compatible",
              "trusted-community",
              "unverified-community"
            ]
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "publisherVerified": {
            "type": "boolean"
          },
          "hosts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          },
          "assetKinds": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "skill",
                "plugin",
                "mcp-server",
                "agent",
                "instruction",
                "workflow",
                "hook",
                "extension",
                "prompt-pack",
                "reference-pack"
              ]
            }
          },
          "includePaths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "excludePaths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "mcpServerPaths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "enabled": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
