{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sommatic.ai/schemas/git-sync/package.schema.json",
  "title": "Sommatic package manifest (sommatic.json)",
  "description": "A folder that contains sommatic.json is a package: the unit Sommatic browses and syncs from Git. Manifests under templates/ or .github/ are examples and are ignored.",
  "type": "object",
  "required": ["name", "version", "schema_version", "resources"],
  "properties": {
    "name": { "type": "string", "description": "Package name." },
    "title": { "type": "string", "description": "Human-readable title shown in Sommatic." },
    "version": { "type": "string", "description": "Package version (semver)." },
    "schema_version": { "type": "string", "const": "1.0" },
    "resources": {
      "type": "object",
      "properties": {
        "workflows": { "type": "array", "items": { "$ref": "#/$defs/entry" } },
        "knowledge": { "type": "array", "items": { "$ref": "#/$defs/entry" } }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "entry": {
      "type": "object",
      "required": ["key", "path"],
      "properties": {
        "key": {
          "type": "string",
          "description": "Logical, stable identifier (for example `support.triage`), independent of the physical id of the resource in each installation."
        },
        "path": { "type": "string", "description": "File path, relative to the package folder." }
      },
      "additionalProperties": false
    }
  }
}
