{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dgadsuq3fvhh4.cloudfront.net/docs/agent/schema/index.schema.json",
  "title": "Cyberart agent documentation index",
  "description": "Machine-readable projection of the Cyberart documentation manifest. contentHash is sha256 of the canonical (key-sorted) JSON without generatedAt and contentHash.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://dgadsuq3fvhh4.cloudfront.net/docs/agent/schema/index.schema.json"
    },
    "schemaVersion": {
      "type": "integer",
      "const": 2
    },
    "manifestSchemaVersion": {
      "type": "integer"
    },
    "generatedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
    },
    "sourceRevision": {
      "type": "string",
      "pattern": "^([0-9a-f]{7,40}|unknown)$"
    },
    "enginePackageName": {
      "type": "string",
      "minLength": 1
    },
    "enginePackageVersion": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "contentHash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "framework": {
      "type": "object",
      "properties": {
        "name": {
          "const": "Cyberart"
        },
        "enginePackageName": {
          "type": "string",
          "minLength": 1
        },
        "enginePackageVersion": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "siteOrigin": {
          "type": "string",
          "pattern": "^https?://[^/\\s]+$"
        },
        "summary": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "name",
        "enginePackageName",
        "enginePackageVersion",
        "siteOrigin",
        "summary"
      ],
      "additionalProperties": false
    },
    "routes": {
      "type": "object",
      "properties": {
        "landingRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "docsRoot": {
          "type": "string",
          "pattern": "^/"
        },
        "gettingStartedRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "featureIndexRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "featureRoutePattern": {
          "type": "string",
          "pattern": "^/"
        },
        "exampleRoutePattern": {
          "type": "string",
          "pattern": "^/"
        },
        "agentIndexRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "agentFeatureRoutePattern": {
          "type": "string",
          "pattern": "^/"
        },
        "agentMarkdownRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "agentIndexSchemaRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "agentFeatureSchemaRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "llmsTxtRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "sitemapRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "robotsRoute": {
          "type": "string",
          "pattern": "^/"
        }
      },
      "required": [
        "landingRoute",
        "docsRoot",
        "gettingStartedRoute",
        "featureIndexRoute",
        "featureRoutePattern",
        "exampleRoutePattern",
        "agentIndexRoute",
        "agentFeatureRoutePattern",
        "agentMarkdownRoute",
        "agentIndexSchemaRoute",
        "agentFeatureSchemaRoute",
        "llmsTxtRoute",
        "sitemapRoute",
        "robotsRoute"
      ],
      "additionalProperties": false
    },
    "sectionKinds": {
      "$ref": "#/$defs/sectionKinds"
    },
    "sections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/section"
      },
      "minItems": 1
    },
    "features": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/feature"
      }
    },
    "examples": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/example"
      }
    },
    "redirects": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/activeRedirect"
      }
    },
    "plannedRedirects": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/plannedRedirect"
      }
    },
    "deprecations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/deprecation"
      }
    },
    "omittedModules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/omittedModule"
      }
    }
  },
  "required": [
    "$schema",
    "schemaVersion",
    "manifestSchemaVersion",
    "generatedAt",
    "sourceRevision",
    "enginePackageName",
    "enginePackageVersion",
    "contentHash",
    "framework",
    "routes",
    "sectionKinds",
    "sections",
    "features",
    "examples",
    "redirects",
    "plannedRedirects",
    "deprecations",
    "omittedModules"
  ],
  "additionalProperties": false,
  "$defs": {
    "sectionKinds": {
      "type": "object",
      "properties": {
        "normative": {
          "type": "string",
          "minLength": 1
        },
        "tutorial": {
          "type": "string",
          "minLength": 1
        },
        "example": {
          "type": "string",
          "minLength": 1
        },
        "provenance": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "normative",
        "tutorial",
        "example",
        "provenance"
      ],
      "additionalProperties": false
    },
    "section": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "enum": [
            "problem",
            "when-to-use",
            "conceptual-model",
            "lifecycle",
            "cart-vs-host",
            "contract",
            "failure",
            "accessibility",
            "example",
            "expected-result",
            "source",
            "related",
            "advanced",
            "version"
          ]
        },
        "anchor": {
          "type": "string",
          "minLength": 1
        },
        "heading": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "normative",
            "tutorial",
            "example",
            "provenance"
          ]
        },
        "required": {
          "type": "boolean"
        },
        "purpose": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "id",
        "anchor",
        "heading",
        "kind",
        "required",
        "purpose"
      ],
      "additionalProperties": false
    },
    "pageSection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "enum": [
            "problem",
            "when-to-use",
            "conceptual-model",
            "lifecycle",
            "cart-vs-host",
            "contract",
            "failure",
            "accessibility",
            "example",
            "expected-result",
            "source",
            "related",
            "advanced",
            "version"
          ]
        },
        "anchor": {
          "type": "string",
          "minLength": 1
        },
        "heading": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "normative",
            "tutorial",
            "example",
            "provenance"
          ]
        },
        "required": {
          "type": "boolean"
        },
        "purpose": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "anchor",
        "heading",
        "kind",
        "required",
        "purpose",
        "text"
      ],
      "additionalProperties": false
    },
    "compatibleEngineVersions": {
      "type": "object",
      "properties": {
        "min": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "max": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        }
      },
      "required": [
        "min"
      ],
      "additionalProperties": false
    },
    "documentationSource": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "engine-guide"
            },
            "path": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "kind",
            "path"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "engine-readme"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "section": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "path"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "site-page"
            },
            "path": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "kind",
            "path"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "none"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "reason"
          ],
          "additionalProperties": false
        }
      ]
    },
    "lifecycle": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "substantial",
            "experimental",
            "deprecated"
          ]
        },
        "introducedIn": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "compatibleEngineVersions": {
          "$ref": "#/$defs/compatibleEngineVersions"
        },
        "normative": {
          "type": "boolean"
        },
        "experimental": {
          "type": "boolean"
        },
        "deprecated": {
          "type": "boolean"
        },
        "successorFeatureIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        }
      },
      "required": [
        "status",
        "introducedIn",
        "compatibleEngineVersions",
        "normative",
        "experimental",
        "deprecated",
        "successorFeatureIds"
      ],
      "additionalProperties": false
    },
    "evidence": {
      "type": "object",
      "properties": {
        "implementationPath": {
          "type": "string",
          "minLength": 1
        },
        "tests": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "engineGuide": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "implementationPath",
        "tests"
      ],
      "additionalProperties": false
    },
    "example": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]*$"
        },
        "route": {
          "type": "string",
          "pattern": "^/"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "purpose": {
          "type": "string",
          "minLength": 1
        },
        "featureIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        },
        "runtimeKind": {
          "type": "string",
          "enum": [
            "render",
            "calculation"
          ]
        },
        "artifact": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "available",
                "unavailable",
                "incompatible",
                "unsupported"
              ]
            },
            "reason": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "state",
            "reason"
          ],
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "public",
                "restricted"
              ]
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "files": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1
            }
          },
          "required": [
            "state",
            "reason",
            "files"
          ],
          "additionalProperties": false
        },
        "provenance": {
          "type": "object",
          "properties": {
            "repository": {
              "type": "string",
              "minLength": 1
            },
            "commit": {
              "type": "string",
              "pattern": "^[0-9a-f]{40}$"
            },
            "engineVersion": {
              "type": "string",
              "pattern": "^\\d+\\.\\d+\\.\\d+$"
            },
            "sourceUrl": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "repository",
            "commit",
            "engineVersion",
            "sourceUrl"
          ],
          "additionalProperties": false
        },
        "capabilities": {
          "type": "object",
          "properties": {
            "permissions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "assets": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "network": {
              "type": "string",
              "minLength": 1
            },
            "credentials": {
              "type": "string",
              "minLength": 1
            },
            "engineCapabilityFile": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "permissions",
            "assets",
            "network",
            "credentials"
          ],
          "additionalProperties": false
        },
        "interaction": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "none",
                "pointer",
                "keyboard",
                "scripted"
              ]
            },
            "notes": {
              "type": "string"
            }
          },
          "required": [
            "mode"
          ],
          "additionalProperties": false
        },
        "expected": {
          "type": "object",
          "properties": {
            "visible": {
              "type": "string"
            },
            "audible": {
              "type": "string"
            }
          },
          "required": [
            "visible",
            "audible"
          ],
          "additionalProperties": false
        },
        "accessibility": {
          "type": "object",
          "properties": {
            "notes": {
              "type": "string"
            },
            "fallback": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "viewport": {
          "type": "object",
          "properties": {
            "width": {
              "type": "integer"
            },
            "height": {
              "type": "integer"
            }
          },
          "required": [
            "width",
            "height"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "route",
        "title",
        "purpose",
        "featureIds",
        "runtimeKind",
        "artifact",
        "source",
        "provenance",
        "capabilities",
        "interaction",
        "expected",
        "accessibility",
        "viewport"
      ],
      "additionalProperties": false
    },
    "feature": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]*$"
        },
        "slug": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]*$"
        },
        "route": {
          "type": "string",
          "pattern": "^/"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "purpose": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "substantial",
            "supporting",
            "internal",
            "deprecated",
            "experimental",
            "intentionally-omitted"
          ]
        },
        "navGroup": {
          "type": "string",
          "enum": [
            "core",
            "input",
            "events-presentation",
            "assets-audio",
            "layout",
            "composition",
            "world-content",
            "host-testing"
          ]
        },
        "packageName": {
          "type": "string",
          "minLength": 1
        },
        "enginePackageVersion": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "compatibleEngineVersions": {
          "$ref": "#/$defs/compatibleEngineVersions"
        },
        "documentationSource": {
          "$ref": "#/$defs/documentationSource"
        },
        "exampleIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        },
        "relatedFeatureIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        },
        "prerequisiteFeatureIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "surfaces": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "browser",
              "headless"
            ]
          },
          "minItems": 1
        },
        "primaryExports": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "agentRoute": {
          "type": "string",
          "pattern": "^/"
        },
        "summary": {
          "type": "string",
          "minLength": 1
        },
        "owningModule": {
          "type": "string",
          "minLength": 1
        },
        "lifecycle": {
          "$ref": "#/$defs/lifecycle"
        },
        "evidence": {
          "$ref": "#/$defs/evidence"
        },
        "redirectsFrom": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^/"
          }
        },
        "examples": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/example"
          }
        },
        "pageSections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/pageSection"
          }
        }
      },
      "required": [
        "id",
        "slug",
        "route",
        "title",
        "purpose",
        "status",
        "navGroup",
        "packageName",
        "enginePackageVersion",
        "compatibleEngineVersions",
        "documentationSource",
        "exampleIds",
        "relatedFeatureIds",
        "prerequisiteFeatureIds",
        "aliases",
        "keywords",
        "surfaces",
        "primaryExports",
        "agentRoute",
        "summary",
        "owningModule",
        "lifecycle",
        "evidence",
        "redirectsFrom",
        "examples",
        "pageSections"
      ],
      "additionalProperties": false
    },
    "deprecation": {
      "type": "object",
      "properties": {
        "featureId": {
          "type": "string",
          "minLength": 1
        },
        "route": {
          "type": "string",
          "pattern": "^/"
        },
        "successorFeatureIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*$"
          }
        }
      },
      "required": [
        "featureId",
        "route",
        "successorFeatureIds"
      ],
      "additionalProperties": false
    },
    "omittedModule": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "internal",
            "intentionally-omitted"
          ]
        },
        "reason": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "path",
        "status",
        "reason"
      ],
      "additionalProperties": false
    },
    "activeRedirect": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^/"
        },
        "to": {
          "type": "string",
          "pattern": "^/"
        },
        "kind": {
          "type": "string",
          "enum": [
            "alias",
            "relocate",
            "redirect"
          ]
        },
        "status": {
          "const": "active"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "from",
        "to",
        "kind",
        "status"
      ],
      "additionalProperties": false
    },
    "plannedRedirect": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^/"
        },
        "to": {
          "type": "string",
          "pattern": "^/"
        },
        "kind": {
          "type": "string",
          "enum": [
            "alias",
            "relocate",
            "redirect"
          ]
        },
        "status": {
          "const": "planned"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "from",
        "to",
        "kind",
        "status"
      ],
      "additionalProperties": false
    }
  }
}
