{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "ProductDeclaration"
    },
    "declarationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "ownerRepo": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "concepts": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "ConceptDefinition"
          },
          "conceptId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ownerRepo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "schemaRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ontologyId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "capabilityIds": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "commandNames": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "relationships": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "targetConceptId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "cardinality": {
                  "type": "string",
                  "enum": [
                    "one",
                    "optional",
                    "many"
                  ]
                }
              },
              "required": [
                "kind",
                "targetConceptId",
                "cardinality"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "contract",
          "conceptId",
          "ownerRepo",
          "displayName",
          "schemaRef",
          "capabilityIds",
          "commandNames",
          "relationships"
        ],
        "additionalProperties": false
      }
    },
    "ontologies": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "OntologyDefinition"
          },
          "ontologyId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "dataSpaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ownerRepo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "bodySchemaRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "authority": {
            "type": "object",
            "properties": {
              "service": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "storage": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "scope": {
                "type": "string",
                "enum": [
                  "tenant",
                  "team",
                  "user",
                  "global"
                ]
              }
            },
            "required": [
              "service",
              "storage",
              "scope"
            ],
            "additionalProperties": false
          },
          "relationKinds": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "metricKinds": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        },
        "required": [
          "contract",
          "ontologyId",
          "dataSpaceId",
          "ownerRepo",
          "bodySchemaRef",
          "authority",
          "relationKinds",
          "metricKinds"
        ],
        "additionalProperties": false
      }
    },
    "projections": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "ProjectionSpec"
          },
          "projectionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ontologyIds": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "outputSchemaRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "operator": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "query",
                  "aggregate",
                  "relationship",
                  "search",
                  "custom"
                ]
              },
              "configuration": {
                "default": {},
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            },
            "required": [
              "kind",
              "configuration"
            ],
            "additionalProperties": false
          },
          "materialization": {
            "type": "string",
            "enum": [
              "on-demand",
              "event-driven",
              "scheduled"
            ]
          },
          "invalidationEvents": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "rebuildable": {
            "type": "boolean",
            "const": true
          },
          "lineagePolicy": {
            "type": "object",
            "properties": {
              "sourceRecords": {
                "type": "boolean"
              },
              "bodyVersions": {
                "type": "boolean"
              },
              "runRefs": {
                "type": "boolean"
              },
              "actorRefs": {
                "type": "boolean"
              }
            },
            "required": [
              "sourceRecords",
              "bodyVersions",
              "runRefs",
              "actorRefs"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contract",
          "projectionId",
          "ontologyIds",
          "outputSchemaRef",
          "operator",
          "materialization",
          "invalidationEvents",
          "rebuildable",
          "lineagePolicy"
        ],
        "additionalProperties": false
      }
    },
    "commands": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "DomainCommandDefinition"
          },
          "commandName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ownerRepo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "targetKinds": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "inputSchemaRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "outputSchemaRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "sensitiveInputPaths": {
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\/.*"
            }
          },
          "sensitiveResultPaths": {
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\/.*"
            }
          },
          "requiredPermissionCodes": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "handlerRef": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "version": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ]
              },
              "ownerRepo": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          },
          "sideEffects": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "data-write",
                "execution",
                "navigation",
                "notification",
                "external-call"
              ]
            }
          }
        },
        "required": [
          "contract",
          "commandName",
          "ownerRepo",
          "displayName",
          "targetKinds",
          "inputSchemaRef",
          "requiredPermissionCodes",
          "handlerRef",
          "sideEffects"
        ],
        "additionalProperties": false
      }
    },
    "capabilities": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "CapabilityManifest"
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "capabilityVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ownerRepo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "kind": {
            "type": "string",
            "enum": [
              "primitive",
              "composite",
              "view",
              "professional-provider",
              "tool",
              "workflow"
            ]
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "ports": {
            "type": "object",
            "properties": {
              "inputs": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "schemaRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "required": {
                      "default": false,
                      "type": "boolean"
                    },
                    "multiple": {
                      "default": false,
                      "type": "boolean"
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "schemaRef",
                    "required",
                    "multiple"
                  ],
                  "additionalProperties": false
                }
              },
              "outputs": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "schemaRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "required": {
                      "default": false,
                      "type": "boolean"
                    },
                    "multiple": {
                      "default": false,
                      "type": "boolean"
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "schemaRef",
                    "required",
                    "multiple"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "inputs",
              "outputs"
            ],
            "additionalProperties": false
          },
          "runtime": {
            "type": "object",
            "properties": {
              "providerBindings": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "providerRef": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "version": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "string",
                              "minLength": 1
                            }
                          ]
                        },
                        "ownerRepo": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        }
                      },
                      "required": [
                        "kind",
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    "productContexts": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "studio",
                          "kernel"
                        ]
                      }
                    },
                    "priority": {
                      "default": 0,
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "providerRef",
                    "productContexts",
                    "priority"
                  ],
                  "additionalProperties": false
                }
              },
              "loading": {
                "type": "string",
                "enum": [
                  "eager",
                  "lazy",
                  "viewport",
                  "on-activation"
                ]
              },
              "fallbackCapabilityRef": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "string",
                        "minLength": 1
                      }
                    ]
                  },
                  "ownerRepo": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "kind",
                  "id"
                ],
                "additionalProperties": false
              },
              "stateOwner": {
                "type": "string",
                "enum": [
                  "host",
                  "provider",
                  "external"
                ]
              },
              "stateSchemaRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "sideEffects": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "network",
                    "storage",
                    "navigation",
                    "clipboard",
                    "worker",
                    "websocket"
                  ]
                }
              }
            },
            "required": [
              "providerBindings",
              "loading",
              "stateOwner",
              "sideEffects"
            ],
            "additionalProperties": false
          },
          "placement": {
            "type": "object",
            "properties": {
              "surfaces": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "slots": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "variants": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "tokenRefs": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              }
            },
            "required": [
              "surfaces",
              "slots",
              "variants",
              "tokenRefs"
            ],
            "additionalProperties": false
          },
          "accessibility": {
            "type": "object",
            "properties": {
              "keyboardModel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "focusModel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "labelContract": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "keyboardModel",
              "focusModel",
              "labelContract"
            ],
            "additionalProperties": false
          },
          "observability": {
            "type": "object",
            "properties": {
              "eventNamespace": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "metrics": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "evidenceRefs": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "performanceBudgetMs": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "eventNamespace",
              "metrics",
              "evidenceRefs"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contract",
          "id",
          "capabilityVersion",
          "ownerRepo",
          "kind",
          "displayName",
          "ports",
          "runtime",
          "placement",
          "accessibility",
          "observability"
        ],
        "additionalProperties": false
      }
    },
    "pages": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "PageDefinition"
          },
          "pageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ownerRepo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2}|-\\d{3})?$"
                },
                "additionalProperties": {
                  "type": "string",
                  "minLength": 1
                }
              }
            ]
          },
          "pageType": {
            "type": "string",
            "enum": [
              "page",
              "workspace",
              "view",
              "record",
              "action",
              "overlay",
              "agent",
              "process",
              "log",
              "chat",
              "preview",
              "api",
              "enhanced",
              "agent-chat",
              "agent-config",
              "agent-log",
              "design-board",
              "global-design-board",
              "iframe"
            ]
          },
          "ownership": {
            "type": "object",
            "properties": {
              "teamId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "creatorRef": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "string",
                        "minLength": 1
                      }
                    ]
                  },
                  "ownerRepo": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "kind",
                  "id"
                ],
                "additionalProperties": false
              },
              "studioId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "builtIn": {
                "type": "boolean"
              }
            },
            "required": [
              "builtIn"
            ],
            "additionalProperties": false
          },
          "record": {
            "type": "object",
            "properties": {
              "createdTimestamp": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedTimestamp": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "deleted": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "deleted"
            ],
            "additionalProperties": false
          },
          "surface": {
            "type": "string",
            "enum": [
              "page",
              "workspace",
              "view",
              "record",
              "action",
              "overlay",
              "agent"
            ]
          },
          "routeId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "routePath": {
            "type": "string",
            "pattern": "^\\/(?!\\/)"
          },
          "legacyRoutePolicy": {
            "type": "object",
            "properties": {
              "contract": {
                "type": "string",
                "const": "LegacyRoutePolicy"
              },
              "schemaVersion": {
                "type": "number",
                "const": 1
              },
              "fallback": {
                "type": "string",
                "enum": [
                  "allowed",
                  "forbidden"
                ]
              },
              "restoration": {
                "type": "string",
                "enum": [
                  "allowed",
                  "forbidden"
                ]
              }
            },
            "required": [
              "contract",
              "schemaVersion",
              "fallback",
              "restoration"
            ],
            "additionalProperties": false
          },
          "rendererKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "capabilityRef": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "version": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ]
              },
              "ownerRepo": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          },
          "capabilityRefs": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "version": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "string",
                      "minLength": 1
                    }
                  ]
                },
                "ownerRepo": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "required": [
                "kind",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "workflowRef": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "version": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ]
              },
              "ownerRepo": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          },
          "binding": {
            "type": "object",
            "properties": {
              "sourceRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "ontologyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "projectionRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "stateRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "additionalProperties": false
          },
          "access": {
            "type": "object",
            "properties": {
              "actions": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "read",
                    "write",
                    "execute",
                    "manage-permissions"
                  ]
                }
              }
            },
            "required": [
              "actions"
            ],
            "additionalProperties": false
          },
          "input": {
            "type": "object",
            "properties": {
              "schemaRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "schemaRef"
            ],
            "additionalProperties": false
          },
          "rendererConfig": {
            "type": "object",
            "properties": {
              "schemaRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "value": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            },
            "required": [
              "schemaRef",
              "value"
            ],
            "additionalProperties": false
          },
          "navigation": {
            "type": "object",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2}|-\\d{3})?$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                ]
              },
              "iconRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "parentPageId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "order": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "hidden": {
                "default": false,
                "type": "boolean"
              },
              "pinned": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "label",
              "hidden",
              "pinned"
            ],
            "additionalProperties": false
          },
          "visibility": {
            "type": "object",
            "properties": {
              "authenticated": {
                "default": true,
                "type": "boolean"
              },
              "permissionAllOf": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "permissionAnyOf": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "featureFlags": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "productContexts": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "studio",
                    "kernel"
                  ]
                }
              }
            },
            "required": [
              "authenticated",
              "permissionAllOf",
              "permissionAnyOf",
              "featureFlags",
              "productContexts"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contract",
          "pageId",
          "ownerRepo",
          "title",
          "pageType",
          "ownership",
          "record",
          "surface",
          "routeId",
          "routePath",
          "rendererKey",
          "capabilityRef",
          "capabilityRefs",
          "binding",
          "access",
          "rendererConfig",
          "navigation",
          "visibility"
        ],
        "additionalProperties": false
      }
    },
    "menus": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "const": "MenuDefinition"
          },
          "version": {
            "type": "number",
            "const": 1
          },
          "applicationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "surface": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "menuId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "nodes": {
            "maxItems": 1024,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "nodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentNodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "order": {
                      "type": "integer",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    "kind": {
                      "type": "string",
                      "const": "group"
                    },
                    "label": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2}|-\\d{3})?$"
                          },
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      ]
                    },
                    "iconRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "disabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "nodeId",
                    "order",
                    "kind"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "nodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentNodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "order": {
                      "type": "integer",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    "kind": {
                      "type": "string",
                      "const": "divider"
                    }
                  },
                  "required": [
                    "nodeId",
                    "order",
                    "kind"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "nodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentNodeId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "order": {
                      "type": "integer",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    "kind": {
                      "type": "string",
                      "const": "item"
                    },
                    "label": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2}|-\\d{3})?$"
                          },
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      ]
                    },
                    "iconRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "tone": {
                      "type": "string",
                      "enum": [
                        "default",
                        "danger"
                      ]
                    },
                    "disabled": {
                      "type": "boolean"
                    },
                    "requiredPermission": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "behavior": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "navigate"
                            },
                            "page": {
                              "type": "object",
                              "properties": {
                                "applicationId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "pageId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                }
                              },
                              "required": [
                                "applicationId",
                                "pageId"
                              ],
                              "additionalProperties": false
                            },
                            "activationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "input": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "exposure": {
                                      "type": "string",
                                      "const": "client"
                                    },
                                    "value": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "exposure",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "exposure": {
                                      "type": "string",
                                      "const": "server"
                                    },
                                    "value": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "exposure",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "action"
                            },
                            "actionRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "actionRef"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "required": [
                    "nodeId",
                    "order",
                    "kind",
                    "label",
                    "behavior"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "contributions": {
            "default": [],
            "maxItems": 1024,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "providerId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "parentNodeId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "order": {
                  "type": "integer",
                  "minimum": -1000000,
                  "maximum": 1000000
                }
              },
              "required": [
                "providerId",
                "order"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "contract",
          "version",
          "applicationId",
          "surface",
          "menuId",
          "nodes",
          "contributions"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "contract",
    "declarationId",
    "ownerRepo",
    "concepts",
    "ontologies",
    "projections",
    "commands",
    "capabilities",
    "pages",
    "menus"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "$id": "https://schemas.infmonkeys.com/contracts/product-declaration.schema.json",
  "title": "product-declaration"
}
