{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentdirective.org/schemas/bundle-manifest-v1.schema.json",
  "title": "AgentDirective Bundle Manifest v1",
  "description": "File inventory and checksums for a generated AgentDirective bundle.",
  "type": "object",
  "additionalProperties": false,
  "required": ["manifest_version", "directive_id", "created_at", "files"],
  "properties": {
    "$schema": { "type": "string", "format": "uri-reference" },
    "manifest_version": { "$ref": "#/$defs/semver" },
    "directive_id": { "type": "string", "pattern": "^AD-[A-Z0-9]{6,32}$" },
    "created_at": { "type": "string", "format": "date-time" },
    "files": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["path", "sha256", "bytes"],
        "properties": {
          "path": { "type": "string", "minLength": 1, "maxLength": 500, "not": { "pattern": "^(?:[A-Za-z]:|/|\\\\)" } },
          "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
          "bytes": { "type": "integer", "minimum": 0 }
        }
      }
    }
  },
  "$defs": {
    "semver": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$" }
  }
}
