{
  "openapi": "3.1.0",
  "info": {
    "title": "AIDC Developer API",
    "version": "1.24.0",
    "description": "Generated from src/server/api/contracts.ts — do not edit by hand. Envelope, error codes and guard semantics: docs/api-standards.md. Regenerate: npm run openapi:generate."
  },
  "security": [
    {
      "aidcSession": []
    }
  ],
  "paths": {
    "/api/v1/developer/device-codes": {
      "post": {
        "operationId": "v1.developer.device-codes.create",
        "summary": "Start an aidc CLI device login (RFC 8628 semantics): returns deviceCode (kept by the CLI), userCode and the verification URI a signed-in developer opens to approve.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "rate_limited",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientName": {
                    "default": "aidc CLI",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/device-codes/decision": {
      "post": {
        "operationId": "v1.developer.device-codes.decision",
        "summary": "Signed-in developer approves or denies a pending CLI login and picks the company the issued developer key acts for (same-origin browser request).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "invalid_session",
          "forbidden",
          "rate_limited",
          "device_code_expired",
          "malformed_json",
          "invalid_payload"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userCode": {
                    "type": "string",
                    "pattern": "^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "deny"
                    ]
                  },
                  "cellId": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "userCode",
                  "decision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/device-tokens": {
      "post": {
        "operationId": "v1.developer.device-tokens.exchange",
        "summary": "CLI polls with its deviceCode: authorization_pending until approved, then a one-time developer key (aidc-dk-…, plaintext only in this response). Polling faster than the interval returns rate_limited.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "authorization_pending",
          "access_denied",
          "device_code_expired",
          "rate_limited",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deviceCode": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{32,128}$"
                  }
                },
                "required": [
                  "deviceCode"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/password-tokens": {
      "post": {
        "operationId": "v1.developer.password-tokens.create",
        "summary": "aidc CLI terminal login (the default aidc login): a person types their AIDC username or email and password; returns a login key (aidc-dk-…, plaintext only in this response) issued to that account for one company, with that person's role there (developer, or member — login required, members included; members may only call apps). An account that belongs to no company gets forbidden. Same password check, lockout and rate-limit buckets as web login; an account that can act for several companies must pass cellId (company_required lists them). Supports dry-run (checks the credentials, returns the company the key would act for).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "invalid_credentials",
          "email_verification_required",
          "password_change_required",
          "company_required",
          "forbidden",
          "rate_limited",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 254
                  },
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "cellId": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "clientName": {
                    "default": "aidc CLI",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "login",
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/me": {
      "get": {
        "operationId": "v1.developer.me",
        "summary": "Identity behind a login key (aidc whoami): account, company it acts for, role (developer | member), key prefix and writable app namespaces (none for members).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Developer key",
            "schema": {
              "type": "string",
              "pattern": "^Bearer aidc-dk-"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/keys": {
      "get": {
        "operationId": "v1.developer.keys",
        "summary": "Developer keys issued by the caller (prefix only). Accepts a developer key or a signed-in session.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/keys/{keyId}": {
      "delete": {
        "operationId": "v1.developer.keys.revoke",
        "summary": "Revoke one of the caller's developer keys (idempotent).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "invalid_path",
          "agent_key_not_found",
          "forbidden"
        ],
        "security": [],
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps": {
      "get": {
        "operationId": "v1.developer.apps",
        "summary": "Nexus apps visible to the developer key: its company's namespace, plus the official public namespace for AIDC platform keys.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}": {
      "get": {
        "operationId": "v1.developer.apps.get",
        "summary": "One app: test/production channel pointers, version history (digest, size, tested) and its Developer / Nexus URLs.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "invalid_path",
          "forbidden",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/versions": {
      "post": {
        "operationId": "v1.developer.apps.versions.create",
        "summary": "Upload a version bundle (manifest + files). Every version carries a semantic version number (manifest.version); content-addressed: identical files return the existing version (200) instead of creating one (201) — retries are idempotent; changed content under an already-used version number is refused (409 version_conflict). x-aidc-dry-run: true returns 202 with the plan.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "invalid_path",
          "forbidden",
          "bundle_invalid",
          "version_conflict",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "manifest": {
                    "type": "object",
                    "properties": {
                      "$schema": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "manifestVersion": {
                        "type": "number",
                        "const": 1
                      },
                      "slug": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9-]{1,47}$"
                      },
                      "version": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})(-[0-9A-Za-z.-]{1,32})?$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      "summary": {
                        "default": "",
                        "type": "string",
                        "maxLength": 240
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "examples": {
                        "default": [],
                        "maxItems": 6,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 2,
                          "maxLength": 120
                        }
                      },
                      "category": {
                        "default": "general",
                        "type": "string",
                        "enum": [
                          "vision",
                          "voice",
                          "video",
                          "data",
                          "agent",
                          "general"
                        ]
                      },
                      "owner": {
                        "type": "object",
                        "properties": {
                          "department": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 40
                          },
                          "team": {
                            "type": "string",
                            "maxLength": 40
                          },
                          "contact": {
                            "type": "string",
                            "maxLength": 60
                          }
                        },
                        "required": [
                          "department"
                        ],
                        "additionalProperties": false
                      },
                      "namespace": {
                        "type": "string",
                        "pattern": "^(public|cell-[a-z0-9][a-z0-9-]{1,62})$"
                      },
                      "entry": {
                        "default": "index.html",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 120,
                            "pattern": "^[a-z0-9][a-z0-9._/-]*\\.html$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "mcpUi": {
                        "type": "string",
                        "maxLength": 120,
                        "pattern": "^[a-z0-9][a-z0-9._/-]*\\.html$"
                      },
                      "sdk": {
                        "default": [],
                        "maxItems": 15,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "vision",
                            "voice",
                            "video",
                            "model",
                            "modeling",
                            "semantic",
                            "evolve",
                            "ui",
                            "data",
                            "connect",
                            "workflow",
                            "auth",
                            "log",
                            "billing",
                            "improve"
                          ]
                        }
                      },
                      "permissions": {
                        "default": {
                          "camera": false,
                          "microphone": false
                        },
                        "type": "object",
                        "properties": {
                          "camera": {
                            "default": false,
                            "type": "boolean"
                          },
                          "microphone": {
                            "default": false,
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      },
                      "models": {
                        "default": [],
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        }
                      },
                      "datasets": {
                        "default": [],
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        }
                      },
                      "streams": {
                        "default": [],
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{1,47}$"
                        }
                      },
                      "cameras": {
                        "default": [],
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{1,47}$"
                        }
                      },
                      "agents": {
                        "default": false,
                        "type": "boolean"
                      },
                      "semantic": {
                        "default": {
                          "types": [],
                          "actions": [],
                          "write": []
                        },
                        "type": "object",
                        "properties": {
                          "types": {
                            "default": [],
                            "maxItems": 24,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                {
                                  "type": "string",
                                  "const": "*"
                                }
                              ]
                            }
                          },
                          "actions": {
                            "default": [],
                            "maxItems": 24,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                {
                                  "type": "string",
                                  "const": "*"
                                }
                              ]
                            }
                          },
                          "write": {
                            "default": [],
                            "maxItems": 24,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                {
                                  "type": "string",
                                  "const": "*"
                                }
                              ]
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "exports": {
                        "default": [],
                        "maxItems": 24,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "default": "",
                                  "type": "string",
                                  "maxLength": 400
                                },
                                "input": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "text",
                                          "integer",
                                          "real",
                                          "numeric",
                                          "boolean",
                                          "date",
                                          "timestamp",
                                          "json",
                                          "text[]",
                                          "number[]"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 40
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 300
                                      },
                                      "required": {
                                        "default": false,
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "query"
                                },
                                "type": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "where": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 1000
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "ne",
                                            "in",
                                            "nin",
                                            "gt",
                                            "gte",
                                            "lt",
                                            "lte",
                                            "contains",
                                            "startsWith",
                                            "null"
                                          ]
                                        },
                                        "additionalProperties": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 1000
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "maxItems": 50,
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 1000
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "select": {
                                  "maxItems": 40,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "sort": {
                                  "maxItems": 3,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 49,
                                    "pattern": "^-?[a-z][a-z0-9_]*$"
                                  }
                                },
                                "limit": {
                                  "default": 200,
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 500
                                }
                              },
                              "required": [
                                "name",
                                "title",
                                "kind",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "default": "",
                                  "type": "string",
                                  "maxLength": 400
                                },
                                "input": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "text",
                                          "integer",
                                          "real",
                                          "numeric",
                                          "boolean",
                                          "date",
                                          "timestamp",
                                          "json",
                                          "text[]",
                                          "number[]"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 40
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 300
                                      },
                                      "required": {
                                        "default": false,
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "get"
                                },
                                "type": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "pk": {
                                  "type": "string",
                                  "maxLength": 1000
                                },
                                "select": {
                                  "maxItems": 40,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "title",
                                "kind",
                                "type",
                                "pk"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "default": "",
                                  "type": "string",
                                  "maxLength": 400
                                },
                                "input": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "text",
                                          "integer",
                                          "real",
                                          "numeric",
                                          "boolean",
                                          "date",
                                          "timestamp",
                                          "json",
                                          "text[]",
                                          "number[]"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 40
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 300
                                      },
                                      "required": {
                                        "default": false,
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "aggregate"
                                },
                                "type": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "where": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 1000
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "ne",
                                            "in",
                                            "nin",
                                            "gt",
                                            "gte",
                                            "lt",
                                            "lte",
                                            "contains",
                                            "startsWith",
                                            "null"
                                          ]
                                        },
                                        "additionalProperties": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 1000
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "maxItems": 50,
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 1000
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "groupBy": {
                                  "default": [],
                                  "maxItems": 3,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "metrics": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 40,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "count"
                                      },
                                      {
                                        "type": "array",
                                        "prefixItems": [
                                          {
                                            "type": "string",
                                            "maxLength": 48,
                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "string",
                                            "enum": [
                                              "count",
                                              "sum",
                                              "avg",
                                              "min",
                                              "max"
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "title",
                                "kind",
                                "type",
                                "metrics"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "default": "",
                                  "type": "string",
                                  "maxLength": 400
                                },
                                "input": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "text",
                                          "integer",
                                          "real",
                                          "numeric",
                                          "boolean",
                                          "date",
                                          "timestamp",
                                          "json",
                                          "text[]",
                                          "number[]"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 40
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 300
                                      },
                                      "required": {
                                        "default": false,
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "action"
                                },
                                "action": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "object": {
                                  "type": "string",
                                  "maxLength": 1000
                                },
                                "params": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 48,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "name",
                                "title",
                                "kind",
                                "action"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "workflow": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "default": "",
                            "type": "string",
                            "maxLength": 600
                          },
                          "input": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_]{0,39}$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "text",
                                    "integer",
                                    "real",
                                    "numeric",
                                    "boolean",
                                    "date",
                                    "timestamp",
                                    "json",
                                    "text[]",
                                    "number[]"
                                  ]
                                },
                                "title": {
                                  "type": "string",
                                  "maxLength": 40
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                "required": {
                                  "default": false,
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "trigger": {
                            "default": {
                              "manual": {
                                "roles": [
                                  "developer",
                                  "member",
                                  "editor"
                                ],
                                "preview": "members"
                              }
                            },
                            "type": "object",
                            "properties": {
                              "manual": {
                                "default": {
                                  "roles": [
                                    "developer",
                                    "member",
                                    "editor"
                                  ],
                                  "preview": "members"
                                },
                                "type": "object",
                                "properties": {
                                  "roles": {
                                    "default": [
                                      "developer",
                                      "member",
                                      "editor"
                                    ],
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "developer",
                                        "member",
                                        "editor"
                                      ]
                                    }
                                  },
                                  "preview": {
                                    "default": "members",
                                    "type": "string",
                                    "enum": [
                                      "members",
                                      "public"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "change": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "maxLength": 80,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                  },
                                  "when": {
                                    "type": "string",
                                    "maxLength": 1000
                                  },
                                  "input": {
                                    "default": {},
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "cooldown": {
                                    "type": "string",
                                    "pattern": "^([1-9]\\d{0,3})(m|h|d)$"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              "schedule": {
                                "type": "object",
                                "properties": {
                                  "every": {
                                    "type": "string",
                                    "pattern": "^([1-9]\\d{0,3})(m|h|d)$"
                                  },
                                  "at": {
                                    "type": "string",
                                    "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                                  },
                                  "input": {
                                    "default": {},
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                    },
                                    "additionalProperties": {}
                                  }
                                },
                                "required": [
                                  "every"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "steps": {
                            "minItems": 1,
                            "maxItems": 40,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                    },
                                    "title": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "description": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 300
                                    },
                                    "lane": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "when": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "after": {
                                      "default": [],
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                      }
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "use"
                                    },
                                    "use": {
                                      "type": "string",
                                      "pattern": "^([a-z][a-z0-9-]{1,47})\\/([a-z][A-Za-z0-9_-]{0,63}(?:\\.[a-z][A-Za-z0-9_-]{0,63}){0,4})$"
                                    },
                                    "with": {
                                      "default": {},
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                      },
                                      "additionalProperties": {}
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "title",
                                    "kind",
                                    "use"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                    },
                                    "title": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "description": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 300
                                    },
                                    "lane": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "when": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "after": {
                                      "default": [],
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                      }
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "compute"
                                    },
                                    "from": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "join": {
                                      "default": [],
                                      "maxItems": 4,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "rows": {
                                            "type": "string",
                                            "maxLength": 1000
                                          },
                                          "on": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 48,
                                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "array",
                                                "prefixItems": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 48,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  {
                                                    "type": "string",
                                                    "maxLength": 48,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  }
                                                ]
                                              }
                                            ]
                                          },
                                          "as": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                          }
                                        },
                                        "required": [
                                          "rows",
                                          "on",
                                          "as"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "filter": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "fields": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "summary": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string",
                                        "maxLength": 1000
                                      }
                                    },
                                    "sort": {
                                      "maxItems": 3,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 49,
                                        "pattern": "^-?[a-z][a-z0-9_]*$"
                                      }
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "title",
                                    "kind",
                                    "fields"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                    },
                                    "title": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "description": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 300
                                    },
                                    "lane": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "when": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "after": {
                                      "default": [],
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                      }
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "model"
                                    },
                                    "model": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64
                                    },
                                    "system": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 8000
                                    },
                                    "output": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string",
                                        "enum": [
                                          "text",
                                          "number",
                                          "boolean",
                                          "text[]",
                                          "json"
                                        ]
                                      }
                                    },
                                    "maxTokens": {
                                      "default": 1200,
                                      "type": "integer",
                                      "minimum": 100,
                                      "maximum": 4000
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "title",
                                    "kind",
                                    "model",
                                    "prompt",
                                    "output"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                    },
                                    "title": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "description": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 300
                                    },
                                    "lane": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "when": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "after": {
                                      "default": [],
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,31}$"
                                      }
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "notify"
                                    },
                                    "channel": {
                                      "default": "email",
                                      "type": "string",
                                      "const": "email"
                                    },
                                    "to": {
                                      "minItems": 1,
                                      "maxItems": 5,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 254,
                                        "format": "email",
                                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                      }
                                    },
                                    "subject": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "body": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 8000
                                    },
                                    "dedupe": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "cooldown": {
                                      "default": "6h",
                                      "type": "string",
                                      "pattern": "^([1-9]\\d{0,3})(m|h|d)$"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "title",
                                    "kind",
                                    "to",
                                    "subject",
                                    "body"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "output": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_]{0,39}$"
                            },
                            "additionalProperties": {}
                          },
                          "outputLabels": {
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                }
                              },
                              "required": [
                                "key",
                                "title"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "lanes": {
                            "maxItems": 12,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            }
                          }
                        },
                        "required": [
                          "steps"
                        ],
                        "additionalProperties": false
                      },
                      "auth": {
                        "default": {
                          "access": "company",
                          "publicLink": "signin"
                        },
                        "type": "object",
                        "properties": {
                          "access": {
                            "default": "company",
                            "type": "string",
                            "enum": [
                              "company",
                              "restricted"
                            ]
                          },
                          "publicLink": {
                            "default": "signin",
                            "type": "string",
                            "enum": [
                              "open",
                              "signin",
                              "members"
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "storage": {
                        "default": {
                          "type": "none"
                        },
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "none"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      "limits": {
                        "default": {
                          "dailyTokens": 1000000,
                          "requestsPerMinute": 30,
                          "realtimeSessionsPerDay": 100,
                          "computeMinutesPerMonth": 2000,
                          "notificationsPerDay": 20
                        },
                        "type": "object",
                        "properties": {
                          "dailyTokens": {
                            "default": 1000000,
                            "type": "integer",
                            "minimum": 1000,
                            "maximum": 50000000
                          },
                          "requestsPerMinute": {
                            "default": 30,
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 600
                          },
                          "realtimeSessionsPerDay": {
                            "default": 100,
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 5000
                          },
                          "computeMinutesPerMonth": {
                            "default": 2000,
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 100000
                          },
                          "notificationsPerDay": {
                            "default": 20,
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 500
                          },
                          "monthlyBudgetUsd": {
                            "type": "number",
                            "exclusiveMinimum": 0,
                            "maximum": 1000000
                          },
                          "worldCreditsPerDay": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100000
                          }
                        },
                        "additionalProperties": false
                      },
                      "cdn": {
                        "default": [],
                        "maxItems": 2,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "cdn.jsdelivr.net",
                            "cdnjs.cloudflare.com"
                          ]
                        }
                      },
                      "evolve": {
                        "type": "object",
                        "properties": {
                          "slots": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 20
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "aliases": {
                                  "maxItems": 8,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 2,
                                    "maxLength": 20
                                  }
                                }
                              },
                              "required": [
                                "title"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "tokens": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^--[a-z][a-z0-9-]{0,47}$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 20
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "length",
                                    "color",
                                    "number"
                                  ]
                                },
                                "min": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "max": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "slot": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9-]{0,39}$"
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 200
                                }
                              },
                              "required": [
                                "title",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "baked": {
                            "default": [],
                            "maxItems": 1000,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[a-z0-9]{20,40}$"
                            }
                          },
                          "model": {
                            "default": "deepseek-flash",
                            "type": "string",
                            "enum": [
                              "deepseek-flash",
                              "gpt-5.4-mini"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "manifestVersion",
                      "slug",
                      "version",
                      "title"
                    ],
                    "additionalProperties": false
                  },
                  "files": {
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "pattern": "^(?!.*(?:^|\\/)\\.)(?!.*\\.\\.)[A-Za-z0-9_\\-][A-Za-z0-9_\\-./]{0,199}$"
                        },
                        "encoding": {
                          "type": "string",
                          "enum": [
                            "utf8",
                            "base64"
                          ]
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 5242880
                        }
                      },
                      "required": [
                        "path",
                        "encoding",
                        "content"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "manifest",
                  "files"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/channels/{channel}": {
      "post": {
        "operationId": "v1.developer.apps.channels.promote",
        "summary": "Point a channel (test | production) at a version (semantic version number or build number). Idempotent. production only accepts versions that have been on test (defaults to the current test version); naming an earlier tested version rolls back. Every change is recorded in the release history (action test | release | rollback, notes). Supports x-aidc-dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "invalid_path",
          "forbidden",
          "app_not_found",
          "app_version_not_found",
          "version_not_tested",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})(-[0-9A-Za-z.-]{1,32})?$"
                      }
                    ]
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/tickets": {
      "post": {
        "operationId": "v1.developer.apps.tickets.create",
        "summary": "Renew the short-lived app ticket (aidc-at-…) the browser SDK uses. Sandboxed company apps renew with Authorization: Bearer <current ticket> (accepted up to 24 h after expiry; the viewer is re-verified — account still has access, or the share is still active — FIX-0146). Cookie path (same-origin, rate limited per IP): every app requires sign-in (login required, 2026-09-29) — official apps any signed-in company member, company apps a member (production) or developer (test). Tickets always carry the signed-in viewer (account, name, role developer|member|editor|viewer, share); tickets without a viewer are rejected and cannot be renewed.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "invalid_path",
          "unauthorized",
          "forbidden",
          "invalid_session",
          "rate_limited",
          "app_not_found",
          "live_unconfigured"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "test",
                "production"
              ],
              "default": "production"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/datasets": {
      "get": {
        "operationId": "v1.developer.datasets",
        "summary": "Datasets the caller may read (developer key: public datasets; app ticket: datasets declared in the app manifest).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/datasets/{datasetId}/reports/{reportId}": {
      "get": {
        "operationId": "v1.developer.datasets.reports.get",
        "summary": "Fixed-format report of a dataset — aggregates only, never row-level data (e.g. aidc-demo-erp/overview: KPIs, monthly trend, customers, AR ageing, inventory risk, rule-based signals).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "dataset_not_found",
          "report_not_found",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/streams": {
      "get": {
        "operationId": "v1.developer.streams.list",
        "summary": "Connect SDK data streams of the caller's company (plus public for AIDC staff), with publisher status (ok | degraded | source_unreachable | stopped, last seen, live).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.streams.declare",
        "summary": "Declare a data stream (idempotent upsert): name, optional row key, field allowlist (published rows/events may only carry these fields; sensitive categories refused), event retention. Supports x-aidc-dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "stream_conflict",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,47}$"
                  },
                  "namespace": {
                    "type": "string",
                    "pattern": "^(public|cell-[a-z0-9][a-z0-9-]{1,62})$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "summary": {
                    "default": "",
                    "type": "string",
                    "maxLength": 240
                  },
                  "key": {
                    "type": "string",
                    "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
                  },
                  "fields": {
                    "minItems": 1,
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
                        },
                        "type": {
                          "default": "string",
                          "type": "string",
                          "enum": [
                            "string",
                            "number",
                            "boolean",
                            "datetime",
                            "json"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "retention": {
                    "default": 1000,
                    "type": "integer",
                    "minimum": 10,
                    "maximum": 10000
                  }
                },
                "required": [
                  "name",
                  "title",
                  "fields"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/streams/{namespace}/{name}": {
      "get": {
        "operationId": "v1.developer.streams.get",
        "summary": "A data stream and its latest materialized state (rows keyed by the stream key, or a single value). Readable with a developer key of the company or an app ticket whose manifest declares the stream.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.streams.delete",
        "summary": "Delete a data stream: its event log and state are physically deleted and its publish keys revoked. A stream that is still a datasource of an object type definition is refused (409 stream_in_use; remove it from the definition first). Supports x-aidc-dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found",
          "stream_in_use"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/streams/{namespace}/{name}/events": {
      "get": {
        "operationId": "v1.developer.streams.events.subscribe",
        "summary": "Subscribe. Accept: text/event-stream (or ?sse=1) opens a Server-Sent Events stream: state (full state), change (patch), notice (event), publisher (publisher status), reconnect; every event carries id = sequence number and ?after=N (or Last-Event-ID) resumes without gaps. Without SSE returns JSON increments after N (reset=true with the full state when N is too old).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found",
          "rate_limited",
          "quota_exhausted"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "sse",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.streams.events.publish",
        "summary": "Publish up to 100 events (snapshot | patch | event | status) with a publish key (aidc-pk-, one stream only) or a developer key. The whole batch is prechecked against the field allowlist; an event id seen before is dropped (idempotent retries); a status equal to the current one counts as a heartbeat. Each accepted event gets the next sequence number and wakes subscribers.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found",
          "stream_event_rejected",
          "rate_limited",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "events": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "snapshot"
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_.:-]{1,128}$"
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "data": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "rows": {
                                      "maxItems": 20000,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      }
                                    }
                                  },
                                  "required": [
                                    "rows"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    }
                                  },
                                  "required": [
                                    "value"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "patch"
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_.:-]{1,128}$"
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "data": {
                              "type": "object",
                              "properties": {
                                "upsert": {
                                  "default": [],
                                  "maxItems": 20000,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  }
                                },
                                "delete": {
                                  "default": [],
                                  "maxItems": 20000,
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "type",
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "event"
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_.:-]{1,128}$"
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "data": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            }
                          },
                          "required": [
                            "type",
                            "data"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "status"
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_.:-]{1,128}$"
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "data": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "ok",
                                    "degraded",
                                    "source_unreachable",
                                    "stopped"
                                  ]
                                },
                                "detail": {
                                  "type": "string",
                                  "maxLength": 300
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "type",
                            "data"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/streams/{namespace}/{name}/keys": {
      "get": {
        "operationId": "v1.developer.streams.keys.list",
        "summary": "Publish keys of a stream (prefix, label, created, last used, revoked).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.streams.keys.issue",
        "summary": "Issue a publish key (aidc-pk-…) that can only publish to this stream — installed with the publisher on the customer side. The plaintext is returned once.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "stream_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "label"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.streams.keys.revoke",
        "summary": "Revoke a publish key by prefix (?prefix=aidc-pk-xxxxxxxx…).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_payload",
          "stream_not_found",
          "resource_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/semantic/{namespace}": {
      "get": {
        "operationId": "v1.developer.semantic.describe",
        "summary": "Semantic SDK: the company's semantic layer as the caller may see it — object types (properties with title, unit, synonyms, enum, references, writeback), links, actions (with whether the caller may apply them), enums, current semantic version and an LLM-ready markdown description. App tickets only see types declared in the manifest.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/semantic/{namespace}/types": {
      "get": {
        "operationId": "v1.developer.semantic.types.list",
        "summary": "All ontology entries (object / link / enum / action, including archived and department-level) for developers.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.semantic.types.defineMany",
        "summary": "Define several ontology entries at once (a directory). The whole batch is checked for reference closure together — references inside the batch count, also in dry-run — and nothing is written if it does not close; entries are applied in dependency order (enum → object → link → action). Returns created / breaking per entry against the last semantic version. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_schema",
          "entity_exists",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "definitions": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "object"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "columns": {
                                  "minItems": 1,
                                  "maxItems": 256,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "array",
                                          "struct",
                                          "vector",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "timeseries",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking",
                                          "text",
                                          "real",
                                          "numeric",
                                          "json"
                                        ]
                                      },
                                      "primaryKey": {
                                        "type": "boolean"
                                      },
                                      "notNull": {
                                        "type": "boolean"
                                      },
                                      "unique": {
                                        "type": "boolean"
                                      },
                                      "default": {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      "enumRef": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "references": {
                                        "type": "object",
                                        "properties": {
                                          "entity": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "column": {
                                            "type": "string",
                                            "maxLength": 64,
                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                          }
                                        },
                                        "required": [
                                          "entity"
                                        ]
                                      },
                                      "comment": {
                                        "type": "string",
                                        "maxLength": 200
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "unit": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 16
                                      },
                                      "synonyms": {
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        }
                                      },
                                      "writeback": {
                                        "type": "boolean"
                                      },
                                      "visibility": {
                                        "type": "string",
                                        "enum": [
                                          "NORMAL",
                                          "PROMINENT",
                                          "HIDDEN"
                                        ]
                                      },
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "ACTIVE",
                                          "EXPERIMENTAL",
                                          "DEPRECATED",
                                          "EXAMPLE"
                                        ]
                                      },
                                      "valueType": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "sharedProperty": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "arraySubType": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "struct",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking"
                                        ]
                                      },
                                      "structFields": {
                                        "minItems": 1,
                                        "maxItems": 20,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "geopoint"
                                              ]
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 60
                                            },
                                            "description": {
                                              "type": "string",
                                              "maxLength": 500
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "vectorDimension": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 4096
                                      },
                                      "derived": {
                                        "type": "object",
                                        "properties": {
                                          "linkPath": {
                                            "minItems": 1,
                                            "maxItems": 3,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                            }
                                          },
                                          "selection": {
                                            "type": "string",
                                            "maxLength": 64,
                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                          },
                                          "aggregation": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "enum": [
                                                  "count",
                                                  "sum",
                                                  "avg",
                                                  "min",
                                                  "max",
                                                  "approximateCardinality",
                                                  "exactCardinality",
                                                  "collectList",
                                                  "collectSet"
                                                ]
                                              },
                                              "property": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                                              },
                                              "limit": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 100
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "linkPath"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "valueFormatting": {
                                        "type": "object",
                                        "properties": {
                                          "number": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "enum": [
                                                  "standard",
                                                  "percentage",
                                                  "currency",
                                                  "unit",
                                                  "basisPoint",
                                                  "compact"
                                                ]
                                              },
                                              "currencyCode": {
                                                "type": "string",
                                                "pattern": "^[A-Z]{3}$"
                                              },
                                              "unit": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 16
                                              },
                                              "minimumFractionDigits": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 10
                                              },
                                              "maximumFractionDigits": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 10
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "date": {
                                            "type": "object",
                                            "properties": {
                                              "format": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              }
                                            },
                                            "required": [
                                              "format"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "timestamp": {
                                            "type": "object",
                                            "properties": {
                                              "format": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              },
                                              "zoneId": {
                                                "type": "string",
                                                "maxLength": 40
                                              }
                                            },
                                            "required": [
                                              "format"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "boolean": {
                                            "type": "object",
                                            "properties": {
                                              "trueValue": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 20
                                              },
                                              "falseValue": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 20
                                              }
                                            },
                                            "required": [
                                              "trueValue",
                                              "falseValue"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "typeClasses": {
                                        "maxItems": 10,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 40
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 80
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ]
                                  }
                                },
                                "indexes": {
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "columns": {
                                        "minItems": 1,
                                        "maxItems": 8,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        }
                                      },
                                      "unique": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "columns"
                                    ]
                                  }
                                },
                                "titleColumn": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "synonyms": {
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "pluralDisplayName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120
                                },
                                "icon": {
                                  "type": "object",
                                  "properties": {
                                    "blueprint": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9-]{1,40}$"
                                        },
                                        "color": {
                                          "type": "string",
                                          "pattern": "^#[0-9A-Fa-f]{6}$"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "color"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "blueprint"
                                  ],
                                  "additionalProperties": false
                                },
                                "visibility": {
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "PROMINENT",
                                    "HIDDEN"
                                  ]
                                },
                                "groups": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "implements": {
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "interface": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "properties": {
                                        "default": {},
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        },
                                        "additionalProperties": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        }
                                      },
                                      "links": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                        },
                                        "additionalProperties": {
                                          "type": "string",
                                          "maxLength": 120,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                        }
                                      }
                                    },
                                    "required": [
                                      "interface"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "datasources": {
                                  "maxItems": 8,
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "stream"
                                          },
                                          "stream": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9-]{1,47}$"
                                          },
                                          "propertyMapping": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                            },
                                            "additionalProperties": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 64
                                            }
                                          },
                                          "mode": {
                                            "default": "mirror",
                                            "type": "string",
                                            "enum": [
                                              "mirror",
                                              "upsert"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "stream",
                                          "propertyMapping"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "dataset"
                                          },
                                          "dataset": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9-]{1,62}$"
                                          },
                                          "propertyMapping": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                            },
                                            "additionalProperties": {
                                              "type": "string",
                                              "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
                                            }
                                          },
                                          "mode": {
                                            "default": "mirror",
                                            "type": "string",
                                            "enum": [
                                              "mirror",
                                              "upsert"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "dataset",
                                          "propertyMapping"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "objectSecurityPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 100
                                    },
                                    "granularPolicy": {
                                      "$ref": "#/$defs/__schema0"
                                    },
                                    "appliedMarkings": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "assumedMarkings": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                "propertySecurityGroups": {
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      "properties": {
                                        "minItems": 1,
                                        "maxItems": 256,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        }
                                      },
                                      "granularPolicy": {
                                        "$ref": "#/$defs/__schema0"
                                      },
                                      "appliedMarkings": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "assumedMarkings": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string",
                                          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "properties"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "dataSecurity": {
                                  "type": "object",
                                  "properties": {
                                    "markingConstraint": {
                                      "type": "object",
                                      "properties": {
                                        "markingIds": {
                                          "minItems": 1,
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                          }
                                        },
                                        "allowEmptyMarkings": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "markingIds"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "columns"
                              ]
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "enum"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "values": {
                                  "minItems": 1,
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64
                                  }
                                }
                              },
                              "required": [
                                "values"
                              ]
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "link"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "to": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "cardinality": {
                                  "type": "string",
                                  "enum": [
                                    "1:1",
                                    "1:N",
                                    "N:1",
                                    "N:M"
                                  ]
                                },
                                "columns": {
                                  "maxItems": 16,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "array",
                                          "struct",
                                          "vector",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "timeseries",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking",
                                          "text",
                                          "real",
                                          "numeric",
                                          "json"
                                        ]
                                      },
                                      "primaryKey": {
                                        "type": "boolean"
                                      },
                                      "notNull": {
                                        "type": "boolean"
                                      },
                                      "unique": {
                                        "type": "boolean"
                                      },
                                      "default": {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      "enumRef": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "references": {
                                        "type": "object",
                                        "properties": {
                                          "entity": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "column": {
                                            "type": "string",
                                            "maxLength": 64,
                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                          }
                                        },
                                        "required": [
                                          "entity"
                                        ]
                                      },
                                      "comment": {
                                        "type": "string",
                                        "maxLength": 200
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "unit": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 16
                                      },
                                      "synonyms": {
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        }
                                      },
                                      "writeback": {
                                        "type": "boolean"
                                      },
                                      "visibility": {
                                        "type": "string",
                                        "enum": [
                                          "NORMAL",
                                          "PROMINENT",
                                          "HIDDEN"
                                        ]
                                      },
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "ACTIVE",
                                          "EXPERIMENTAL",
                                          "DEPRECATED",
                                          "EXAMPLE"
                                        ]
                                      },
                                      "valueType": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "sharedProperty": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "arraySubType": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "struct",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking"
                                        ]
                                      },
                                      "structFields": {
                                        "minItems": 1,
                                        "maxItems": 20,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "geopoint"
                                              ]
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 60
                                            },
                                            "description": {
                                              "type": "string",
                                              "maxLength": 500
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "vectorDimension": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 4096
                                      },
                                      "derived": {
                                        "type": "object",
                                        "properties": {
                                          "linkPath": {
                                            "minItems": 1,
                                            "maxItems": 3,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                            }
                                          },
                                          "selection": {
                                            "type": "string",
                                            "maxLength": 64,
                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                          },
                                          "aggregation": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "enum": [
                                                  "count",
                                                  "sum",
                                                  "avg",
                                                  "min",
                                                  "max",
                                                  "approximateCardinality",
                                                  "exactCardinality",
                                                  "collectList",
                                                  "collectSet"
                                                ]
                                              },
                                              "property": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                                              },
                                              "limit": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 100
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "linkPath"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "valueFormatting": {
                                        "type": "object",
                                        "properties": {
                                          "number": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "enum": [
                                                  "standard",
                                                  "percentage",
                                                  "currency",
                                                  "unit",
                                                  "basisPoint",
                                                  "compact"
                                                ]
                                              },
                                              "currencyCode": {
                                                "type": "string",
                                                "pattern": "^[A-Z]{3}$"
                                              },
                                              "unit": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 16
                                              },
                                              "minimumFractionDigits": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 10
                                              },
                                              "maximumFractionDigits": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 10
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "date": {
                                            "type": "object",
                                            "properties": {
                                              "format": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              }
                                            },
                                            "required": [
                                              "format"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "timestamp": {
                                            "type": "object",
                                            "properties": {
                                              "format": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              },
                                              "zoneId": {
                                                "type": "string",
                                                "maxLength": 40
                                              }
                                            },
                                            "required": [
                                              "format"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "boolean": {
                                            "type": "object",
                                            "properties": {
                                              "trueValue": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 20
                                              },
                                              "falseValue": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 20
                                              }
                                            },
                                            "required": [
                                              "trueValue",
                                              "falseValue"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "typeClasses": {
                                        "maxItems": 10,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 40
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 80
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ]
                                  }
                                },
                                "apiNameAtoB": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                },
                                "apiNameBtoA": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                },
                                "displayNameAtoB": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120
                                },
                                "displayNameBtoA": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120
                                },
                                "foreignKey": {
                                  "type": "object",
                                  "properties": {
                                    "side": {
                                      "type": "string",
                                      "enum": [
                                        "from",
                                        "to"
                                      ]
                                    },
                                    "property": {
                                      "type": "string",
                                      "maxLength": 64,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    }
                                  },
                                  "required": [
                                    "side",
                                    "property"
                                  ],
                                  "additionalProperties": false
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "ACTIVE",
                                    "EXPERIMENTAL",
                                    "DEPRECATED",
                                    "EXAMPLE"
                                  ]
                                }
                              },
                              "required": [
                                "from",
                                "to"
                              ]
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "action"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "objectType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "operation": {
                                  "type": "string",
                                  "enum": [
                                    "modify",
                                    "create",
                                    "delete"
                                  ]
                                },
                                "parameters": {
                                  "default": [],
                                  "maxItems": 24,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "array",
                                          "struct",
                                          "vector",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "timeseries",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking",
                                          "text",
                                          "real",
                                          "numeric",
                                          "json",
                                          "object",
                                          "objectSet",
                                          "interfaceObject"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 200
                                      },
                                      "required": {
                                        "type": "boolean"
                                      },
                                      "enumRef": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "valueType": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "objectType": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "interfaceType": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      },
                                      "arraySubType": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "struct",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking",
                                          "object"
                                        ]
                                      },
                                      "maxLength": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 20000
                                      },
                                      "min": {
                                        "type": "number"
                                      },
                                      "max": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ]
                                  }
                                },
                                "edits": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "rules": {
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "createObject"
                                          },
                                          "objectType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "values": {
                                            "default": {},
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "additionalProperties": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "objectType"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "modifyObject"
                                          },
                                          "objectType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "object": {
                                            "type": "string",
                                            "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          "values": {
                                            "default": {},
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "additionalProperties": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "objectType",
                                          "object"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "createOrModifyObject"
                                          },
                                          "objectType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "values": {
                                            "default": {},
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "additionalProperties": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "objectType"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "deleteObject"
                                          },
                                          "objectType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "object": {
                                            "type": "string",
                                            "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "objectType",
                                          "object"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "createLink"
                                          },
                                          "linkType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "a": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "b": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "linkType",
                                          "a",
                                          "b"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "deleteLink"
                                          },
                                          "linkType": {
                                            "type": "string",
                                            "maxLength": 80,
                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                          },
                                          "a": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "b": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "linkType",
                                          "a",
                                          "b"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "submissionCriteria": {
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "condition": {
                                        "$ref": "#/$defs/__schema1"
                                      },
                                      "failureMessage": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 300
                                      }
                                    },
                                    "required": [
                                      "condition",
                                      "failureMessage"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "roles": {
                                  "minItems": 1,
                                  "maxItems": 3,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "developer",
                                      "member",
                                      "editor"
                                    ]
                                  }
                                },
                                "summary": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "actionLog": {
                                  "type": "boolean"
                                },
                                "toolDescription": {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                "webhooks": {
                                  "type": "object",
                                  "properties": {
                                    "writeback": {
                                      "type": "object",
                                      "properties": {
                                        "webhook": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9-]{1,31}\\/[a-z][a-z0-9-]{1,63}$"
                                        },
                                        "inputs": {
                                          "default": {},
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                          },
                                          "additionalProperties": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "webhook"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              }
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "interface"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "properties": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 80,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "required": {
                                        "default": true,
                                        "type": "boolean"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "localProperties": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "array",
                                          "struct",
                                          "vector",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "timeseries",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking",
                                          "text",
                                          "real",
                                          "numeric",
                                          "json"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      "required": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "arraySubType": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "struct",
                                          "geopoint",
                                          "geoshape",
                                          "attachment",
                                          "mediaReference",
                                          "geotimeSeriesReference",
                                          "cipherText",
                                          "marking"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "extendsInterfaces": {
                                  "default": [],
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 80,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                  }
                                },
                                "links": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      "linkedEntity": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "objectType": {
                                                "type": "string",
                                                "maxLength": 80,
                                                "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                              }
                                            },
                                            "required": [
                                              "objectType"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "interfaceType": {
                                                "type": "string",
                                                "maxLength": 80,
                                                "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                              }
                                            },
                                            "required": [
                                              "interfaceType"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "cardinality": {
                                        "type": "string",
                                        "enum": [
                                          "ONE",
                                          "MANY"
                                        ]
                                      },
                                      "required": {
                                        "default": false,
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "linkedEntity",
                                      "cardinality"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "icon": {
                                  "type": "object",
                                  "properties": {
                                    "blueprint": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9-]{1,40}$"
                                        },
                                        "color": {
                                          "type": "string",
                                          "pattern": "^#[0-9A-Fa-f]{6}$"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "color"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "blueprint"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "sharedProperty"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct",
                                    "vector",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "timeseries",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "text",
                                    "real",
                                    "numeric",
                                    "json"
                                  ]
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking"
                                  ]
                                },
                                "structFields": {
                                  "minItems": 1,
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "geopoint"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "vectorDimension": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 4096
                                },
                                "valueType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "unit": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 16
                                },
                                "synonyms": {
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "valueFormatting": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "standard",
                                            "percentage",
                                            "currency",
                                            "unit",
                                            "basisPoint",
                                            "compact"
                                          ]
                                        },
                                        "currencyCode": {
                                          "type": "string",
                                          "pattern": "^[A-Z]{3}$"
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 16
                                        },
                                        "minimumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        },
                                        "maximumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "date": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "timestamp": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        },
                                        "zoneId": {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "boolean": {
                                      "type": "object",
                                      "properties": {
                                        "trueValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        },
                                        "falseValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        }
                                      },
                                      "required": [
                                        "trueValue",
                                        "falseValue"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "visibility": {
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "PROMINENT",
                                    "HIDDEN"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "valueType"
                            },
                            "schema": {
                              "type": "object",
                              "properties": {
                                "baseType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct"
                                  ]
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking"
                                  ]
                                },
                                "structFields": {
                                  "minItems": 1,
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "geopoint"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "constraints": {
                                  "default": [],
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "enum"
                                          },
                                          "options": {
                                            "minItems": 1,
                                            "maxItems": 500,
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 200
                                                },
                                                {
                                                  "type": "number"
                                                }
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "options"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "range"
                                          },
                                          "minimumValue": {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string",
                                                "maxLength": 40
                                              }
                                            ]
                                          },
                                          "maximumValue": {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string",
                                                "maxLength": 40
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "length"
                                          },
                                          "minimumLength": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 100000
                                          },
                                          "maximumLength": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 100000
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "regex"
                                          },
                                          "pattern": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 500
                                          },
                                          "partialMatch": {
                                            "default": false,
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "pattern"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "uuid"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "rid"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "array"
                                          },
                                          "minimumSize": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 10000
                                          },
                                          "maximumSize": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 10000
                                          },
                                          "uniqueValues": {
                                            "default": false,
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "struct"
                                          },
                                          "properties": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "additionalProperties": {
                                              "type": "string",
                                              "maxLength": 80,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                            }
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "properties"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "version": {
                                  "default": "1.0.0",
                                  "type": "string",
                                  "pattern": "^\\d+\\.\\d+\\.\\d+$"
                                }
                              },
                              "required": [
                                "baseType"
                              ]
                            },
                            "apiName": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "layer": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department"
                              ]
                            },
                            "department": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "ownerAgentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "promoted",
                                "inferred",
                                "custom"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "experimental",
                                "deprecated",
                                "example"
                              ]
                            },
                            "accessLevel": {
                              "type": "string",
                              "enum": [
                                "company",
                                "department",
                                "group"
                              ]
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "members",
                                "public"
                              ]
                            },
                            "allowedConsumerDepts": {
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "schema",
                            "apiName",
                            "title"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "definitions"
                ],
                "additionalProperties": false,
                "$defs": {
                  "__schema0": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema0"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "and"
                          },
                          "and": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "and"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "or"
                          },
                          "or": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "or"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "not": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            "required": [
                              "condition"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "not"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "true"
                          },
                          "true": {
                            "type": "object",
                            "properties": {},
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "true"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "group"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "type",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "groupProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markingProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markings"
                          },
                          "markings": {
                            "type": "object",
                            "properties": {
                              "property": {
                                "type": "string",
                                "maxLength": 64,
                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                              }
                            },
                            "required": [
                              "property"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "markings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "constantMarkings"
                          },
                          "constantMarkings": {
                            "type": "object",
                            "properties": {
                              "markings": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                }
                              },
                              "markingType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "markings",
                              "markingType"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "constantMarkings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "comparison": {
                            "type": "object",
                            "properties": {
                              "operator": {
                                "type": "string",
                                "enum": [
                                  "EQUAL",
                                  "INTERSECTS",
                                  "SUBSET_OF",
                                  "SUPERSET_OF"
                                ]
                              },
                              "left": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "right": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "operator",
                              "left",
                              "right"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "comparison"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "__schema1": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "left": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "is",
                              "isNot",
                              "matches",
                              "lt",
                              "lte",
                              "gt",
                              "gte",
                              "includes",
                              "includesAny",
                              "isIncludedIn",
                              "eachIs",
                              "eachIsNot",
                              "isNull",
                              "isNotNull"
                            ]
                          },
                          "right": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "left",
                          "operator"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "minItems": 1,
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema1"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "condition": {
                            "$ref": "#/$defs/__schema1"
                          }
                        },
                        "required": [
                          "type",
                          "condition"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/semantic/{namespace}/types/{apiName}": {
      "get": {
        "operationId": "v1.developer.semantic.types.get",
        "summary": "One ontology entry with its full definition (developers).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "entity_not_found",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "apiName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "v1.developer.semantic.types.define",
        "summary": "Define an ontology entry (PUT: create or update; kind cannot change). The whole model after the change must close (action properties / parameters, references, enums) or 422; breaking changes against the last semantic version are returned (recorded at publish, not blocked). Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_schema",
          "entity_exists",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "apiName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "object"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "columns": {
                            "minItems": 1,
                            "maxItems": 256,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct",
                                    "vector",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "timeseries",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "text",
                                    "real",
                                    "numeric",
                                    "json"
                                  ]
                                },
                                "primaryKey": {
                                  "type": "boolean"
                                },
                                "notNull": {
                                  "type": "boolean"
                                },
                                "unique": {
                                  "type": "boolean"
                                },
                                "default": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "enumRef": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "references": {
                                  "type": "object",
                                  "properties": {
                                    "entity": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "column": {
                                      "type": "string",
                                      "maxLength": 64,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    }
                                  },
                                  "required": [
                                    "entity"
                                  ]
                                },
                                "comment": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "unit": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 16
                                },
                                "synonyms": {
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "writeback": {
                                  "type": "boolean"
                                },
                                "visibility": {
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "PROMINENT",
                                    "HIDDEN"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "ACTIVE",
                                    "EXPERIMENTAL",
                                    "DEPRECATED",
                                    "EXAMPLE"
                                  ]
                                },
                                "valueType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "sharedProperty": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking"
                                  ]
                                },
                                "structFields": {
                                  "minItems": 1,
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "geopoint"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "vectorDimension": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 4096
                                },
                                "derived": {
                                  "type": "object",
                                  "properties": {
                                    "linkPath": {
                                      "minItems": 1,
                                      "maxItems": 3,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                      }
                                    },
                                    "selection": {
                                      "type": "string",
                                      "maxLength": 64,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    },
                                    "aggregation": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "count",
                                            "sum",
                                            "avg",
                                            "min",
                                            "max",
                                            "approximateCardinality",
                                            "exactCardinality",
                                            "collectList",
                                            "collectSet"
                                          ]
                                        },
                                        "property": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        },
                                        "limit": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 100
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "linkPath"
                                  ],
                                  "additionalProperties": false
                                },
                                "valueFormatting": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "standard",
                                            "percentage",
                                            "currency",
                                            "unit",
                                            "basisPoint",
                                            "compact"
                                          ]
                                        },
                                        "currencyCode": {
                                          "type": "string",
                                          "pattern": "^[A-Z]{3}$"
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 16
                                        },
                                        "minimumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        },
                                        "maximumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "date": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "timestamp": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        },
                                        "zoneId": {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "boolean": {
                                      "type": "object",
                                      "properties": {
                                        "trueValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        },
                                        "falseValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        }
                                      },
                                      "required": [
                                        "trueValue",
                                        "falseValue"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "typeClasses": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 40
                                      },
                                      "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 80
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ]
                            }
                          },
                          "indexes": {
                            "maxItems": 12,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "columns": {
                                  "minItems": 1,
                                  "maxItems": 8,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "unique": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "columns"
                              ]
                            }
                          },
                          "titleColumn": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          },
                          "synonyms": {
                            "maxItems": 12,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            }
                          },
                          "pluralDisplayName": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "icon": {
                            "type": "object",
                            "properties": {
                              "blueprint": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9-]{1,40}$"
                                  },
                                  "color": {
                                    "type": "string",
                                    "pattern": "^#[0-9A-Fa-f]{6}$"
                                  }
                                },
                                "required": [
                                  "name",
                                  "color"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "blueprint"
                            ],
                            "additionalProperties": false
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "NORMAL",
                              "PROMINENT",
                              "HIDDEN"
                            ]
                          },
                          "groups": {
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            }
                          },
                          "implements": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "interface": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "properties": {
                                  "default": {},
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "links": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "maxLength": 120,
                                    "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                  }
                                }
                              },
                              "required": [
                                "interface"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "datasources": {
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "stream"
                                    },
                                    "stream": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{1,47}$"
                                    },
                                    "propertyMapping": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64
                                      }
                                    },
                                    "mode": {
                                      "default": "mirror",
                                      "type": "string",
                                      "enum": [
                                        "mirror",
                                        "upsert"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "stream",
                                    "propertyMapping"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "dataset"
                                    },
                                    "dataset": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{1,62}$"
                                    },
                                    "propertyMapping": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                      },
                                      "additionalProperties": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
                                      }
                                    },
                                    "mode": {
                                      "default": "mirror",
                                      "type": "string",
                                      "enum": [
                                        "mirror",
                                        "upsert"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "dataset",
                                    "propertyMapping"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "objectSecurityPolicy": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 100
                              },
                              "granularPolicy": {
                                "$ref": "#/$defs/__schema0"
                              },
                              "appliedMarkings": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              },
                              "assumedMarkings": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "propertySecurityGroups": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 100
                                },
                                "properties": {
                                  "minItems": 1,
                                  "maxItems": 256,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 64,
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "granularPolicy": {
                                  "$ref": "#/$defs/__schema0"
                                },
                                "appliedMarkings": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "assumedMarkings": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "properties"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "dataSecurity": {
                            "type": "object",
                            "properties": {
                              "markingConstraint": {
                                "type": "object",
                                "properties": {
                                  "markingIds": {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                    }
                                  },
                                  "allowEmptyMarkings": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "markingIds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "columns"
                        ]
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "enum"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "values": {
                            "minItems": 1,
                            "maxItems": 100,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            }
                          }
                        },
                        "required": [
                          "values"
                        ]
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "link"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string",
                            "maxLength": 80,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                          },
                          "to": {
                            "type": "string",
                            "maxLength": 80,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                          },
                          "cardinality": {
                            "type": "string",
                            "enum": [
                              "1:1",
                              "1:N",
                              "N:1",
                              "N:M"
                            ]
                          },
                          "columns": {
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct",
                                    "vector",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "timeseries",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "text",
                                    "real",
                                    "numeric",
                                    "json"
                                  ]
                                },
                                "primaryKey": {
                                  "type": "boolean"
                                },
                                "notNull": {
                                  "type": "boolean"
                                },
                                "unique": {
                                  "type": "boolean"
                                },
                                "default": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "enumRef": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "references": {
                                  "type": "object",
                                  "properties": {
                                    "entity": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "column": {
                                      "type": "string",
                                      "maxLength": 64,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    }
                                  },
                                  "required": [
                                    "entity"
                                  ]
                                },
                                "comment": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "unit": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 16
                                },
                                "synonyms": {
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "writeback": {
                                  "type": "boolean"
                                },
                                "visibility": {
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "PROMINENT",
                                    "HIDDEN"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "ACTIVE",
                                    "EXPERIMENTAL",
                                    "DEPRECATED",
                                    "EXAMPLE"
                                  ]
                                },
                                "valueType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "sharedProperty": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking"
                                  ]
                                },
                                "structFields": {
                                  "minItems": 1,
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "integer",
                                          "long",
                                          "short",
                                          "byte",
                                          "boolean",
                                          "float",
                                          "double",
                                          "decimal",
                                          "date",
                                          "timestamp",
                                          "geopoint"
                                        ]
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 60
                                      },
                                      "description": {
                                        "type": "string",
                                        "maxLength": 500
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "vectorDimension": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 4096
                                },
                                "derived": {
                                  "type": "object",
                                  "properties": {
                                    "linkPath": {
                                      "minItems": 1,
                                      "maxItems": 3,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                      }
                                    },
                                    "selection": {
                                      "type": "string",
                                      "maxLength": 64,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    },
                                    "aggregation": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "count",
                                            "sum",
                                            "avg",
                                            "min",
                                            "max",
                                            "approximateCardinality",
                                            "exactCardinality",
                                            "collectList",
                                            "collectSet"
                                          ]
                                        },
                                        "property": {
                                          "type": "string",
                                          "maxLength": 64,
                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                        },
                                        "limit": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 100
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "linkPath"
                                  ],
                                  "additionalProperties": false
                                },
                                "valueFormatting": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "standard",
                                            "percentage",
                                            "currency",
                                            "unit",
                                            "basisPoint",
                                            "compact"
                                          ]
                                        },
                                        "currencyCode": {
                                          "type": "string",
                                          "pattern": "^[A-Z]{3}$"
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 16
                                        },
                                        "minimumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        },
                                        "maximumFractionDigits": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "date": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "timestamp": {
                                      "type": "object",
                                      "properties": {
                                        "format": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 40
                                        },
                                        "zoneId": {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "format"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "boolean": {
                                      "type": "object",
                                      "properties": {
                                        "trueValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        },
                                        "falseValue": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 20
                                        }
                                      },
                                      "required": [
                                        "trueValue",
                                        "falseValue"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "typeClasses": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 40
                                      },
                                      "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 80
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ]
                            }
                          },
                          "apiNameAtoB": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                          },
                          "apiNameBtoA": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                          },
                          "displayNameAtoB": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "displayNameBtoA": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "foreignKey": {
                            "type": "object",
                            "properties": {
                              "side": {
                                "type": "string",
                                "enum": [
                                  "from",
                                  "to"
                                ]
                              },
                              "property": {
                                "type": "string",
                                "maxLength": 64,
                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                              }
                            },
                            "required": [
                              "side",
                              "property"
                            ],
                            "additionalProperties": false
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ACTIVE",
                              "EXPERIMENTAL",
                              "DEPRECATED",
                              "EXAMPLE"
                            ]
                          }
                        },
                        "required": [
                          "from",
                          "to"
                        ]
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "action"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "objectType": {
                            "type": "string",
                            "maxLength": 80,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                          },
                          "operation": {
                            "type": "string",
                            "enum": [
                              "modify",
                              "create",
                              "delete"
                            ]
                          },
                          "parameters": {
                            "default": [],
                            "maxItems": 24,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct",
                                    "vector",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "timeseries",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "text",
                                    "real",
                                    "numeric",
                                    "json",
                                    "object",
                                    "objectSet",
                                    "interfaceObject"
                                  ]
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "required": {
                                  "type": "boolean"
                                },
                                "enumRef": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "valueType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "objectType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "interfaceType": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "object"
                                  ]
                                },
                                "maxLength": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 20000
                                },
                                "min": {
                                  "type": "number"
                                },
                                "max": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ]
                            }
                          },
                          "edits": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "maxLength": 64,
                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "rules": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "createObject"
                                    },
                                    "objectType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "values": {
                                      "default": {},
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "additionalProperties": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "objectType"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "modifyObject"
                                    },
                                    "objectType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "object": {
                                      "type": "string",
                                      "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    "values": {
                                      "default": {},
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "additionalProperties": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "objectType",
                                    "object"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "createOrModifyObject"
                                    },
                                    "objectType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "values": {
                                      "default": {},
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "additionalProperties": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "objectType"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "deleteObject"
                                    },
                                    "objectType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "object": {
                                      "type": "string",
                                      "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "objectType",
                                    "object"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "createLink"
                                    },
                                    "linkType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "a": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "b": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "linkType",
                                    "a",
                                    "b"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "deleteLink"
                                    },
                                    "linkType": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "a": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "b": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "linkType",
                                    "a",
                                    "b"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "submissionCriteria": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "condition": {
                                  "$ref": "#/$defs/__schema1"
                                },
                                "failureMessage": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 300
                                }
                              },
                              "required": [
                                "condition",
                                "failureMessage"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "roles": {
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "developer",
                                "member",
                                "editor"
                              ]
                            }
                          },
                          "summary": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "actionLog": {
                            "type": "boolean"
                          },
                          "toolDescription": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "webhooks": {
                            "type": "object",
                            "properties": {
                              "writeback": {
                                "type": "object",
                                "properties": {
                                  "webhook": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9-]{1,31}\\/[a-z][a-z0-9-]{1,63}$"
                                  },
                                  "inputs": {
                                    "default": {},
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "webhook"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "interface"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "properties": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "required": {
                                  "default": true,
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "localProperties": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "maxLength": 64,
                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "array",
                                    "struct",
                                    "vector",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "timeseries",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking",
                                    "text",
                                    "real",
                                    "numeric",
                                    "json"
                                  ]
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                "required": {
                                  "default": true,
                                  "type": "boolean"
                                },
                                "arraySubType": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "struct",
                                    "geopoint",
                                    "geoshape",
                                    "attachment",
                                    "mediaReference",
                                    "geotimeSeriesReference",
                                    "cipherText",
                                    "marking"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "extendsInterfaces": {
                            "default": [],
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            }
                          },
                          "links": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "maxLength": 64,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                "linkedEntity": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "objectType": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        }
                                      },
                                      "required": [
                                        "objectType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "interfaceType": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        }
                                      },
                                      "required": [
                                        "interfaceType"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "cardinality": {
                                  "type": "string",
                                  "enum": [
                                    "ONE",
                                    "MANY"
                                  ]
                                },
                                "required": {
                                  "default": false,
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "linkedEntity",
                                "cardinality"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "icon": {
                            "type": "object",
                            "properties": {
                              "blueprint": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9-]{1,40}$"
                                  },
                                  "color": {
                                    "type": "string",
                                    "pattern": "^#[0-9A-Fa-f]{6}$"
                                  }
                                },
                                "required": [
                                  "name",
                                  "color"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "blueprint"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "sharedProperty"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "long",
                              "short",
                              "byte",
                              "boolean",
                              "float",
                              "double",
                              "decimal",
                              "date",
                              "timestamp",
                              "array",
                              "struct",
                              "vector",
                              "geopoint",
                              "geoshape",
                              "attachment",
                              "mediaReference",
                              "timeseries",
                              "geotimeSeriesReference",
                              "cipherText",
                              "marking",
                              "text",
                              "real",
                              "numeric",
                              "json"
                            ]
                          },
                          "arraySubType": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "long",
                              "short",
                              "byte",
                              "boolean",
                              "float",
                              "double",
                              "decimal",
                              "date",
                              "timestamp",
                              "struct",
                              "geopoint",
                              "geoshape",
                              "attachment",
                              "mediaReference",
                              "geotimeSeriesReference",
                              "cipherText",
                              "marking"
                            ]
                          },
                          "structFields": {
                            "minItems": 1,
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "geopoint"
                                  ]
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "vectorDimension": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 4096
                          },
                          "valueType": {
                            "type": "string",
                            "maxLength": 80,
                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                          },
                          "unit": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 16
                          },
                          "synonyms": {
                            "maxItems": 12,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            }
                          },
                          "valueFormatting": {
                            "type": "object",
                            "properties": {
                              "number": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "standard",
                                      "percentage",
                                      "currency",
                                      "unit",
                                      "basisPoint",
                                      "compact"
                                    ]
                                  },
                                  "currencyCode": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 16
                                  },
                                  "minimumFractionDigits": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  },
                                  "maximumFractionDigits": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              "date": {
                                "type": "object",
                                "properties": {
                                  "format": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                },
                                "required": [
                                  "format"
                                ],
                                "additionalProperties": false
                              },
                              "timestamp": {
                                "type": "object",
                                "properties": {
                                  "format": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "zoneId": {
                                    "type": "string",
                                    "maxLength": 40
                                  }
                                },
                                "required": [
                                  "format"
                                ],
                                "additionalProperties": false
                              },
                              "boolean": {
                                "type": "object",
                                "properties": {
                                  "trueValue": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 20
                                  },
                                  "falseValue": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 20
                                  }
                                },
                                "required": [
                                  "trueValue",
                                  "falseValue"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "NORMAL",
                              "PROMINENT",
                              "HIDDEN"
                            ]
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "valueType"
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "baseType": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "long",
                              "short",
                              "byte",
                              "boolean",
                              "float",
                              "double",
                              "decimal",
                              "date",
                              "timestamp",
                              "array",
                              "struct"
                            ]
                          },
                          "arraySubType": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "long",
                              "short",
                              "byte",
                              "boolean",
                              "float",
                              "double",
                              "decimal",
                              "date",
                              "timestamp",
                              "struct",
                              "geopoint",
                              "geoshape",
                              "attachment",
                              "mediaReference",
                              "geotimeSeriesReference",
                              "cipherText",
                              "marking"
                            ]
                          },
                          "structFields": {
                            "minItems": 1,
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string",
                                    "integer",
                                    "long",
                                    "short",
                                    "byte",
                                    "boolean",
                                    "float",
                                    "double",
                                    "decimal",
                                    "date",
                                    "timestamp",
                                    "geopoint"
                                  ]
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "constraints": {
                            "default": [],
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "enum"
                                    },
                                    "options": {
                                      "minItems": 1,
                                      "maxItems": 500,
                                      "type": "array",
                                      "items": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 200
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "options"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "range"
                                    },
                                    "minimumValue": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    },
                                    "maximumValue": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "length"
                                    },
                                    "minimumLength": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 100000
                                    },
                                    "maximumLength": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 100000
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "regex"
                                    },
                                    "pattern": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    },
                                    "partialMatch": {
                                      "default": false,
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "pattern"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "uuid"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "rid"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "array"
                                    },
                                    "minimumSize": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 10000
                                    },
                                    "maximumSize": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 10000
                                    },
                                    "uniqueValues": {
                                      "default": false,
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "struct"
                                    },
                                    "properties": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      },
                                      "additionalProperties": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "properties"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "version": {
                            "default": "1.0.0",
                            "type": "string",
                            "pattern": "^\\d+\\.\\d+\\.\\d+$"
                          }
                        },
                        "required": [
                          "baseType"
                        ]
                      },
                      "apiName": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "layer": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department"
                        ]
                      },
                      "department": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "ownerAgentId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "promoted",
                          "inferred",
                          "custom"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "experimental",
                          "deprecated",
                          "example"
                        ]
                      },
                      "accessLevel": {
                        "type": "string",
                        "enum": [
                          "company",
                          "department",
                          "group"
                        ]
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "members",
                          "public"
                        ]
                      },
                      "allowedConsumerDepts": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "schema",
                      "apiName",
                      "title"
                    ]
                  }
                ],
                "$defs": {
                  "__schema0": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema0"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "and"
                          },
                          "and": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "and"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "or"
                          },
                          "or": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "or"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "not": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            "required": [
                              "condition"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "not"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "true"
                          },
                          "true": {
                            "type": "object",
                            "properties": {},
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "true"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "group"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "type",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "groupProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markingProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markings"
                          },
                          "markings": {
                            "type": "object",
                            "properties": {
                              "property": {
                                "type": "string",
                                "maxLength": 64,
                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                              }
                            },
                            "required": [
                              "property"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "markings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "constantMarkings"
                          },
                          "constantMarkings": {
                            "type": "object",
                            "properties": {
                              "markings": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                }
                              },
                              "markingType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "markings",
                              "markingType"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "constantMarkings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "comparison": {
                            "type": "object",
                            "properties": {
                              "operator": {
                                "type": "string",
                                "enum": [
                                  "EQUAL",
                                  "INTERSECTS",
                                  "SUBSET_OF",
                                  "SUPERSET_OF"
                                ]
                              },
                              "left": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "right": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "operator",
                              "left",
                              "right"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "comparison"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "__schema1": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "left": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "is",
                              "isNot",
                              "matches",
                              "lt",
                              "lte",
                              "gt",
                              "gte",
                              "includes",
                              "includesAny",
                              "isIncludedIn",
                              "eachIs",
                              "eachIsNot",
                              "isNull",
                              "isNotNull"
                            ]
                          },
                          "right": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "left",
                          "operator"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "minItems": 1,
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema1"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "condition": {
                            "$ref": "#/$defs/__schema1"
                          }
                        },
                        "required": [
                          "type",
                          "condition"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.semantic.types.archive",
        "summary": "Archive an ontology entry (soft delete; excluded from the next semantic version). Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "entity_not_found",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "apiName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/semantic/{namespace}/actions/{apiName}": {
      "post": {
        "operationId": "v1.developer.semantic.actions.apply",
        "summary": "Apply an action — the governed write of the semantic layer. Parameters are validated against the definition; the caller must be allowed (manifest declares the action and the viewer role is in the action roles; viewers never write). Edits land in the semantic layer only (never written back to the source ERP), are logged as an action event in the same transaction and wake subscribers. ifRev = optimistic concurrency. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "action_not_found",
          "semantic_type_not_found",
          "object_not_found",
          "object_exists",
          "rev_mismatch",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "apiName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "params": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    },
                    "additionalProperties": {}
                  },
                  "ifRev": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/semantic/{namespace}/releases": {
      "get": {
        "operationId": "v1.developer.semantic.releases.list",
        "summary": "Semantic versions (platform-assigned vN, additive / breaking decided by server diff, gate evidence).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.semantic.releases.publish",
        "summary": "Publish a semantic version: snapshot all definitions → gates (schema, unique names, reference closure, DDL) → vN. An unchanged snapshot returns the previous version (unchanged=true, no new number).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "empty_snapshot",
          "gate_failed",
          "customer_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/objects/{type}": {
      "get": {
        "operationId": "v1.developer.data.objects.query",
        "summary": "Data SDK: query objects of a type (current values = source values overridden by semantic-layer edits). where = JSON conditions ({prop: value | {eq, ne, in, nin, gt, gte, lt, lte, contains, startsWith, null}}, $or), sort = a,-b, limit ≤ 500, offset, includeGone. Returns total and seq (subscribe from it).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "invalid_query",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "includeGone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.data.objects.create",
        "summary": "Create an object in the semantic layer (developer key, or developer viewer + manifest semantic.write). upsert merges by primary key. Logged. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "object_exists",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "props": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    },
                    "additionalProperties": {}
                  },
                  "upsert": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "props"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/objects/{type}/{pk}": {
      "get": {
        "operationId": "v1.developer.data.objects.get",
        "summary": "One object (props, rev, edited, overridden source values). ?link=<link apiName> adds the linked objects; ?history=1 adds its change history (who, when, origin).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "object_not_found",
          "invalid_query",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "link",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "history",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "v1.developer.data.objects.update",
        "summary": "Edit an object: set writes semantic-layer edits, revert drops edits back to the source value; ifRev = optimistic concurrency. Developers only (members use actions). Logged. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "object_not_found",
          "rev_mismatch",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "set": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    },
                    "additionalProperties": {}
                  },
                  "revert": {
                    "default": [],
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    }
                  },
                  "ifRev": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.data.objects.delete",
        "summary": "Delete an object in the semantic layer (tombstone; the source is untouched). ?ifRev=N. Logged. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "object_not_found",
          "rev_mismatch",
          "invalid_query",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "ifRev",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/aggregate/{type}": {
      "post": {
        "operationId": "v1.developer.data.objects.aggregate",
        "summary": "Aggregate objects: groupBy properties, metrics count / sum / avg / min / max, same conditions as query.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "invalid_query",
          "customer_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "where": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "eq": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "ne": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "in": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "nin": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "gt": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 40
                                    }
                                  ]
                                },
                                "gte": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 40
                                    }
                                  ]
                                },
                                "lt": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 40
                                    }
                                  ]
                                },
                                "lte": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 40
                                    }
                                  ]
                                },
                                "contains": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "startsWith": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "null": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "maxItems": 10,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "maxLength": 48,
                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "ne": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "in": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "nin": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "gt": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    },
                                    "gte": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    },
                                    "lt": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    },
                                    "lte": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      ]
                                    },
                                    "contains": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "startsWith": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "null": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "groupBy": {
                    "default": [],
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    }
                  },
                  "metrics": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 40,
                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "count"
                        },
                        {
                          "type": "array",
                          "prefixItems": [
                            {
                              "type": "string",
                              "maxLength": 48,
                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "count",
                                "sum",
                                "avg",
                                "min",
                                "max"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  },
                  "includeGone": {
                    "default": false,
                    "type": "boolean"
                  },
                  "limit": {
                    "default": 200,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000
                  }
                },
                "required": [
                  "metrics"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/import/{type}": {
      "post": {
        "operationId": "v1.developer.data.objects.import",
        "summary": "Bulk import up to 5000 rows: layer=source (treated as source data, e.g. an ERP export; mode=mirror marks missing objects as gone) or layer=edits. Invalid rows are skipped and listed. Logged. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "customer_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rows": {
                    "minItems": 1,
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "maxLength": 48,
                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                      },
                      "additionalProperties": {}
                    }
                  },
                  "layer": {
                    "default": "source",
                    "type": "string",
                    "enum": [
                      "source",
                      "edits"
                    ]
                  },
                  "mode": {
                    "default": "upsert",
                    "type": "string",
                    "enum": [
                      "upsert",
                      "mirror"
                    ]
                  }
                },
                "required": [
                  "rows"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/changes": {
      "get": {
        "operationId": "v1.developer.data.changes",
        "summary": "Semantic-layer changes. Accept: text/event-stream (or ?sse=1) opens SSE: ready, change ({seq, type, pk, op: upsert|delete, props, origin: sync|edit|action|import, at}), reset (too far behind — query again), reconnect; id = sequence number, ?after=N (or Last-Event-ID) resumes. ?types=a,b narrows to visible types. Without SSE returns JSON increments after N.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "semantic_type_not_found",
          "customer_not_found",
          "quota_exhausted"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sse",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/bindings": {
      "get": {
        "operationId": "v1.developer.data.bindings.list",
        "summary": "Sync bindings (connect stream → object type): mapping, status, applied stream sequence and how far behind.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.data.bindings.upsert",
        "summary": "Bind a connect stream to an object type (idempotent per stream × type) and sync once from the stream's current state; afterwards every committed publish syncs automatically into the objects' source layer (ERP stays read-only; apps and agents read the semantic layer). Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "stream_not_found",
          "semantic_type_not_found",
          "customer_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stream": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,47}$"
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                  },
                  "properties": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48,
                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,47}$"
                    }
                  },
                  "mode": {
                    "default": "mirror",
                    "type": "string",
                    "enum": [
                      "mirror",
                      "upsert"
                    ]
                  }
                },
                "required": [
                  "stream",
                  "type",
                  "properties"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/data/{namespace}/bindings/{id}": {
      "post": {
        "operationId": "v1.developer.data.bindings.resync",
        "summary": "Resync a binding from the stream's current state.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "binding_not_found",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.data.bindings.delete",
        "summary": "Delete a binding (objects stay; their source layer stops at the last sync). Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "binding_not_found",
          "customer_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/auth/me": {
      "get": {
        "operationId": "v1.developer.auth.me",
        "summary": "Permission SDK: who is calling (account, name, role developer|member|editor|viewer, whether via a share; a member's login key answers kind=account, role=member), in which app / channel / version, and what they may do in the semantic layer (readable types, applicable actions, writable types, may share).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/shares": {
      "get": {
        "operationId": "v1.developer.shares.list",
        "summary": "Shares of the company's apps (?app=, ?namespace=); public links show only a prefix.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "namespace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.shares.create",
        "summary": "Share an app (production): company (all members; opens restricted apps), users (a named account, may be outside the company; viewer or editor), public (anyone with the link after signing in, read-only; the full link is returned once). Re-sharing the same company / account updates role and expiry. Audited and logged. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found",
          "account_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "namespace": {
                    "type": "string",
                    "pattern": "^cell-[a-z0-9][a-z0-9-]{1,62}$"
                  },
                  "app": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,47}$"
                  },
                  "audience": {
                    "type": "string",
                    "enum": [
                      "company",
                      "users",
                      "public"
                    ]
                  },
                  "role": {
                    "default": "viewer",
                    "type": "string",
                    "enum": [
                      "viewer",
                      "editor"
                    ]
                  },
                  "account": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "app",
                  "audience"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/members": {
      "get": {
        "operationId": "v1.developer.members.list",
        "summary": "Auth SDK · members: accounts holding a live License of this company (one row each: role developer/member, status active or pending_activation, source, joined/last login). ?namespace= defaults to the caller's company. Company developers only.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "company_not_found",
          "rate_limited"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/members/import": {
      "post": {
        "operationId": "v1.developer.members.import",
        "summary": "Auth SDK · import an existing user list (≤1000 per call) into the AIDC account system as this company's members: unknown emails get a pending, credential-less account (claimed by the person's own email-code login) plus a redeemed member License; existing accounts get a member License; existing developers and members are never changed or downgraded. Idempotent (migrationKey + email); x-aidc-dry-run returns the per-person plan and seat usage. Company developers only.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "company_not_found",
          "license_plan_missing",
          "license_plan_expired",
          "license_quota_exceeded",
          "malformed_json",
          "invalid_payload",
          "payload_too_large",
          "rate_limited"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "namespace": {
                    "type": "string",
                    "pattern": "^cell-[a-z0-9][a-z0-9-]{1,62}$"
                  },
                  "source": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,39}$"
                  },
                  "members": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string",
                          "maxLength": 254,
                          "format": "email",
                          "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        }
                      },
                      "required": [
                        "email"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "source",
                  "members"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/shares/{id}": {
      "delete": {
        "operationId": "v1.developer.shares.revoke",
        "summary": "Revoke a share (soft; the link / grant stops working immediately). Audited and logged.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/log/{namespace}/events": {
      "post": {
        "operationId": "v1.developer.log.events.record",
        "summary": "Log SDK: record usage, feedback (rating + message; gets a status) or an error. App, version, channel and viewer come from the ticket. Actions and shares are recorded by the platform automatically. 120 per minute per viewer.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "usage",
                      "feedback",
                      "error"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "rating": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "object": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                      },
                      "pk": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "type",
                      "pk"
                    ],
                    "additionalProperties": false
                  },
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 48
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "kind",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "v1.developer.log.events.list",
        "summary": "Events (developers): ?app=&kind=usage|feedback|action|error|share&status=&type=&object=&since=&limit=.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_query"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/log/{namespace}/events/{id}": {
      "patch": {
        "operationId": "v1.developer.log.events.update",
        "summary": "Set a feedback status: open → planned → done / dismissed (optionally link a proposal).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "planned",
                      "done",
                      "dismissed"
                    ]
                  },
                  "proposalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/log/{namespace}/summary": {
      "get": {
        "operationId": "v1.developer.log.summary",
        "summary": "Summary for the last N days (?app=, ?days=7): counts by kind, usage by day, visitors, top actions, open feedback, recent errors; with ?app= also every version number's status and the release history; plus semantic versions.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/billing/prices": {
      "get": {
        "operationId": "v1.developer.billing.prices",
        "summary": "Billing SDK: price book of the model catalog — how each model is metered (tokens / audio minutes / realtime sessions), unit prices in USD (per 1M input, cached input and output tokens; per minute; the most a realtime session can cost), DeepSeek off-peak factor, and where each price comes from (vendor = read off the vendor's pricing page, catalog = synced, override = operator, none = unknown). Public like the model catalog; rate-limited per IP.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "rate_limited"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/billing/estimate": {
      "post": {
        "operationId": "v1.developer.billing.estimate",
        "summary": "Billing SDK: plan costs before building — each item is a model × usage (input / cached / output tokens or audio seconds per call, calls per day or month) → cost per call, per day, per month at current prices; DeepSeek off-peak share; fits a monthly budget or not. Pure computation (no ledger writes). Developer key or app ticket.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "rate_limited",
          "model_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "model": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 60
                        },
                        "calls": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1000000000
                        },
                        "inputTokens": {
                          "default": 0,
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        },
                        "cachedInputTokens": {
                          "default": 0,
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        },
                        "outputTokens": {
                          "default": 0,
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        },
                        "audioSeconds": {
                          "default": 0,
                          "type": "number",
                          "minimum": 0,
                          "maximum": 86400
                        },
                        "worldInput": {
                          "type": "string",
                          "enum": [
                            "text",
                            "image",
                            "pano",
                            "multi-image",
                            "video"
                          ]
                        }
                      },
                      "required": [
                        "model",
                        "calls"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "per": {
                    "default": "day",
                    "type": "string",
                    "enum": [
                      "day",
                      "month"
                    ]
                  },
                  "days": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 31
                  },
                  "offPeakShare": {
                    "default": 0,
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "budgetUsd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 10000000
                  }
                },
                "required": [
                  "items"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/billing/{namespace}/summary": {
      "get": {
        "operationId": "v1.developer.billing.summary",
        "summary": "Billing SDK statement (developers of the company): accumulated model cost from the usage ledger — today, the month (UTC) and cumulative; by app, developer key, model and day (with running totals); month-end forecast from the trailing 7-day average; budget status (manifest limits.monthlyBudgetUsd, or ?budget= for planning); unpriced calls listed with the reason (never counted as $0). Amounts are USD strings with 6 decimals; all breakdowns add up to the totals exactly.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}-(0[1-9]|1[0-2])$"
            }
          },
          {
            "name": "app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/billing/{namespace}/records": {
      "get": {
        "operationId": "v1.developer.billing.records",
        "summary": "Billing SDK ledger lines (developers of the company), newest first: time, lane, app or developer key, model, tokens, audio seconds, cost (null = unpriced). ?month= or ?from=&to= (UTC days, inclusive), ?app=, ?model=, ?lane=app|developer, ?limit=1–500, ?cursor= (nextCursor of the previous page).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lane",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "app",
                "developer"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/billing/{namespace}/check": {
      "get": {
        "operationId": "v1.developer.billing.check",
        "summary": "Billing SDK reconciliation (developers of the company): every number of the statement re-derived from the ledger — apps + keys, models and days each add up to the month; an independent row-by-row sum (not the grouped SQL); the raw cost column sum; cumulative ≥ month. Plus a row-by-row re-price at current prices (rows priced under older prices show up as outside the price range — informational). ?month= ?app=.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/evidence": {
      "get": {
        "operationId": "v1.developer.evolve.evidence",
        "summary": "Self-evolution SDK, evidence & proposals: evidence for an app / types (?app=&types=&days=) — usage, feedback, actions, errors, semantic definitions with data profile (null ratio, edits, samples), open proposals.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/proposals": {
      "get": {
        "operationId": "v1.developer.evolve.proposals.list",
        "summary": "Improvement proposals (?status=open|accepted|rejected|applied).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_query"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.evolve.proposals.create",
        "summary": "Propose an improvement: semantic (additive patch: describe, synonyms, addColumn, addEnumValues, addAction) or app (change request), with evidence; linked feedback becomes planned.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "enum": [
                      "semantic",
                      "app",
                      "action",
                      "data"
                    ]
                  },
                  "targetRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "rationale": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "patch": {
                    "anyOf": [
                      {
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "op": {
                                  "type": "string",
                                  "const": "describe"
                                },
                                "entity": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "column": {
                                  "type": "string",
                                  "maxLength": 48,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                "unit": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 16
                                }
                              },
                              "required": [
                                "op",
                                "entity"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "op": {
                                  "type": "string",
                                  "const": "synonyms"
                                },
                                "entity": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "column": {
                                  "type": "string",
                                  "maxLength": 48,
                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                },
                                "add": {
                                  "minItems": 1,
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  }
                                }
                              },
                              "required": [
                                "op",
                                "entity",
                                "add"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "op": {
                                  "type": "string",
                                  "const": "addColumn"
                                },
                                "entity": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "column": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string",
                                      "maxLength": 48,
                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "text",
                                        "integer",
                                        "real",
                                        "numeric",
                                        "boolean",
                                        "date",
                                        "timestamp",
                                        "json"
                                      ]
                                    },
                                    "title": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 60
                                    },
                                    "unit": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 16
                                    },
                                    "comment": {
                                      "type": "string",
                                      "maxLength": 200
                                    },
                                    "enumRef": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                    },
                                    "synonyms": {
                                      "maxItems": 12,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 40
                                      }
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "op",
                                "entity",
                                "column"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "op": {
                                  "type": "string",
                                  "const": "addEnumValues"
                                },
                                "entity": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                },
                                "values": {
                                  "minItems": 1,
                                  "maxItems": 20,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64
                                  }
                                }
                              },
                              "required": [
                                "op",
                                "entity",
                                "values"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "op": {
                                  "type": "string",
                                  "const": "addAction"
                                },
                                "definition": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "object"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "columns": {
                                              "minItems": 1,
                                              "maxItems": 256,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "maxLength": 64,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "array",
                                                      "struct",
                                                      "vector",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "timeseries",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking",
                                                      "text",
                                                      "real",
                                                      "numeric",
                                                      "json"
                                                    ]
                                                  },
                                                  "primaryKey": {
                                                    "type": "boolean"
                                                  },
                                                  "notNull": {
                                                    "type": "boolean"
                                                  },
                                                  "unique": {
                                                    "type": "boolean"
                                                  },
                                                  "default": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  },
                                                  "enumRef": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "references": {
                                                    "type": "object",
                                                    "properties": {
                                                      "entity": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "column": {
                                                        "type": "string",
                                                        "maxLength": 64,
                                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                      }
                                                    },
                                                    "required": [
                                                      "entity"
                                                    ]
                                                  },
                                                  "comment": {
                                                    "type": "string",
                                                    "maxLength": 200
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "unit": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 16
                                                  },
                                                  "synonyms": {
                                                    "maxItems": 12,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 40
                                                    }
                                                  },
                                                  "writeback": {
                                                    "type": "boolean"
                                                  },
                                                  "visibility": {
                                                    "type": "string",
                                                    "enum": [
                                                      "NORMAL",
                                                      "PROMINENT",
                                                      "HIDDEN"
                                                    ]
                                                  },
                                                  "status": {
                                                    "type": "string",
                                                    "enum": [
                                                      "ACTIVE",
                                                      "EXPERIMENTAL",
                                                      "DEPRECATED",
                                                      "EXAMPLE"
                                                    ]
                                                  },
                                                  "valueType": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "sharedProperty": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "arraySubType": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "struct",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking"
                                                    ]
                                                  },
                                                  "structFields": {
                                                    "minItems": 1,
                                                    "maxItems": 20,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "object",
                                                      "properties": {
                                                        "name": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "type": {
                                                          "type": "string",
                                                          "enum": [
                                                            "string",
                                                            "integer",
                                                            "long",
                                                            "short",
                                                            "byte",
                                                            "boolean",
                                                            "float",
                                                            "double",
                                                            "decimal",
                                                            "date",
                                                            "timestamp",
                                                            "geopoint"
                                                          ]
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 60
                                                        },
                                                        "description": {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        }
                                                      },
                                                      "required": [
                                                        "name",
                                                        "type"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "vectorDimension": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 4096
                                                  },
                                                  "derived": {
                                                    "type": "object",
                                                    "properties": {
                                                      "linkPath": {
                                                        "minItems": 1,
                                                        "maxItems": 3,
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "maxLength": 120,
                                                          "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                                        }
                                                      },
                                                      "selection": {
                                                        "type": "string",
                                                        "maxLength": 64,
                                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                      },
                                                      "aggregation": {
                                                        "type": "object",
                                                        "properties": {
                                                          "type": {
                                                            "type": "string",
                                                            "enum": [
                                                              "count",
                                                              "sum",
                                                              "avg",
                                                              "min",
                                                              "max",
                                                              "approximateCardinality",
                                                              "exactCardinality",
                                                              "collectList",
                                                              "collectSet"
                                                            ]
                                                          },
                                                          "property": {
                                                            "type": "string",
                                                            "maxLength": 64,
                                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                          },
                                                          "limit": {
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 100
                                                          }
                                                        },
                                                        "required": [
                                                          "type"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "required": [
                                                      "linkPath"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  "valueFormatting": {
                                                    "type": "object",
                                                    "properties": {
                                                      "number": {
                                                        "type": "object",
                                                        "properties": {
                                                          "type": {
                                                            "type": "string",
                                                            "enum": [
                                                              "standard",
                                                              "percentage",
                                                              "currency",
                                                              "unit",
                                                              "basisPoint",
                                                              "compact"
                                                            ]
                                                          },
                                                          "currencyCode": {
                                                            "type": "string",
                                                            "pattern": "^[A-Z]{3}$"
                                                          },
                                                          "unit": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 16
                                                          },
                                                          "minimumFractionDigits": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 10
                                                          },
                                                          "maximumFractionDigits": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 10
                                                          }
                                                        },
                                                        "required": [
                                                          "type"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "date": {
                                                        "type": "object",
                                                        "properties": {
                                                          "format": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 40
                                                          }
                                                        },
                                                        "required": [
                                                          "format"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "timestamp": {
                                                        "type": "object",
                                                        "properties": {
                                                          "format": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 40
                                                          },
                                                          "zoneId": {
                                                            "type": "string",
                                                            "maxLength": 40
                                                          }
                                                        },
                                                        "required": [
                                                          "format"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "boolean": {
                                                        "type": "object",
                                                        "properties": {
                                                          "trueValue": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 20
                                                          },
                                                          "falseValue": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 20
                                                          }
                                                        },
                                                        "required": [
                                                          "trueValue",
                                                          "falseValue"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  "typeClasses": {
                                                    "maxItems": 10,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 40
                                                        },
                                                        "name": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 80
                                                        }
                                                      },
                                                      "required": [
                                                        "kind",
                                                        "name"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "type"
                                                ]
                                              }
                                            },
                                            "indexes": {
                                              "maxItems": 12,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "columns": {
                                                    "minItems": 1,
                                                    "maxItems": 8,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "maxLength": 64,
                                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                    }
                                                  },
                                                  "unique": {
                                                    "type": "boolean"
                                                  }
                                                },
                                                "required": [
                                                  "columns"
                                                ]
                                              }
                                            },
                                            "titleColumn": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[a-z][A-Za-z0-9_]*$"
                                            },
                                            "synonyms": {
                                              "maxItems": 12,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              }
                                            },
                                            "pluralDisplayName": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 120
                                            },
                                            "icon": {
                                              "type": "object",
                                              "properties": {
                                                "blueprint": {
                                                  "type": "object",
                                                  "properties": {
                                                    "name": {
                                                      "type": "string",
                                                      "pattern": "^[a-z0-9-]{1,40}$"
                                                    },
                                                    "color": {
                                                      "type": "string",
                                                      "pattern": "^#[0-9A-Fa-f]{6}$"
                                                    }
                                                  },
                                                  "required": [
                                                    "name",
                                                    "color"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "blueprint"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "visibility": {
                                              "type": "string",
                                              "enum": [
                                                "NORMAL",
                                                "PROMINENT",
                                                "HIDDEN"
                                              ]
                                            },
                                            "groups": {
                                              "maxItems": 10,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              }
                                            },
                                            "implements": {
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "interface": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "properties": {
                                                    "default": {},
                                                    "type": "object",
                                                    "propertyNames": {
                                                      "type": "string",
                                                      "maxLength": 64,
                                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                    },
                                                    "additionalProperties": {
                                                      "type": "string",
                                                      "maxLength": 64,
                                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                    }
                                                  },
                                                  "links": {
                                                    "type": "object",
                                                    "propertyNames": {
                                                      "type": "string",
                                                      "maxLength": 64,
                                                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                                    },
                                                    "additionalProperties": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "interface"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "datasources": {
                                              "maxItems": 8,
                                              "type": "array",
                                              "items": {
                                                "oneOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "stream"
                                                      },
                                                      "stream": {
                                                        "type": "string",
                                                        "pattern": "^[a-z][a-z0-9-]{1,47}$"
                                                      },
                                                      "propertyMapping": {
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                                        },
                                                        "additionalProperties": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 64
                                                        }
                                                      },
                                                      "mode": {
                                                        "default": "mirror",
                                                        "type": "string",
                                                        "enum": [
                                                          "mirror",
                                                          "upsert"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "stream",
                                                      "propertyMapping"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "dataset"
                                                      },
                                                      "dataset": {
                                                        "type": "string",
                                                        "pattern": "^[a-z][a-z0-9-]{1,62}$"
                                                      },
                                                      "propertyMapping": {
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                                        },
                                                        "additionalProperties": {
                                                          "type": "string",
                                                          "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
                                                        }
                                                      },
                                                      "mode": {
                                                        "default": "mirror",
                                                        "type": "string",
                                                        "enum": [
                                                          "mirror",
                                                          "upsert"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "dataset",
                                                      "propertyMapping"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              }
                                            },
                                            "objectSecurityPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "name": {
                                                  "type": "string",
                                                  "minLength": 1,
                                                  "maxLength": 100
                                                },
                                                "granularPolicy": {
                                                  "$ref": "#/$defs/__schema0"
                                                },
                                                "appliedMarkings": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string",
                                                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "assumedMarkings": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string",
                                                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                }
                                              },
                                              "required": [
                                                "name"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "propertySecurityGroups": {
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  "properties": {
                                                    "minItems": 1,
                                                    "maxItems": 256,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "maxLength": 64,
                                                      "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                    }
                                                  },
                                                  "granularPolicy": {
                                                    "$ref": "#/$defs/__schema0"
                                                  },
                                                  "appliedMarkings": {
                                                    "type": "object",
                                                    "propertyNames": {
                                                      "type": "string",
                                                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                                    },
                                                    "additionalProperties": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "assumedMarkings": {
                                                    "type": "object",
                                                    "propertyNames": {
                                                      "type": "string",
                                                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                                    },
                                                    "additionalProperties": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "properties"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "dataSecurity": {
                                              "type": "object",
                                              "properties": {
                                                "markingConstraint": {
                                                  "type": "object",
                                                  "properties": {
                                                    "markingIds": {
                                                      "minItems": 1,
                                                      "maxItems": 50,
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                                      }
                                                    },
                                                    "allowEmptyMarkings": {
                                                      "type": "boolean"
                                                    }
                                                  },
                                                  "required": [
                                                    "markingIds"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "columns"
                                          ]
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "enum"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "values": {
                                              "minItems": 1,
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 64
                                              }
                                            }
                                          },
                                          "required": [
                                            "values"
                                          ]
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "link"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "from": {
                                              "type": "string",
                                              "maxLength": 80,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                            },
                                            "to": {
                                              "type": "string",
                                              "maxLength": 80,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                            },
                                            "cardinality": {
                                              "type": "string",
                                              "enum": [
                                                "1:1",
                                                "1:N",
                                                "N:1",
                                                "N:M"
                                              ]
                                            },
                                            "columns": {
                                              "maxItems": 16,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "maxLength": 64,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "array",
                                                      "struct",
                                                      "vector",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "timeseries",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking",
                                                      "text",
                                                      "real",
                                                      "numeric",
                                                      "json"
                                                    ]
                                                  },
                                                  "primaryKey": {
                                                    "type": "boolean"
                                                  },
                                                  "notNull": {
                                                    "type": "boolean"
                                                  },
                                                  "unique": {
                                                    "type": "boolean"
                                                  },
                                                  "default": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  },
                                                  "enumRef": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "references": {
                                                    "type": "object",
                                                    "properties": {
                                                      "entity": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "column": {
                                                        "type": "string",
                                                        "maxLength": 64,
                                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                      }
                                                    },
                                                    "required": [
                                                      "entity"
                                                    ]
                                                  },
                                                  "comment": {
                                                    "type": "string",
                                                    "maxLength": 200
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "unit": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 16
                                                  },
                                                  "synonyms": {
                                                    "maxItems": 12,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 40
                                                    }
                                                  },
                                                  "writeback": {
                                                    "type": "boolean"
                                                  },
                                                  "visibility": {
                                                    "type": "string",
                                                    "enum": [
                                                      "NORMAL",
                                                      "PROMINENT",
                                                      "HIDDEN"
                                                    ]
                                                  },
                                                  "status": {
                                                    "type": "string",
                                                    "enum": [
                                                      "ACTIVE",
                                                      "EXPERIMENTAL",
                                                      "DEPRECATED",
                                                      "EXAMPLE"
                                                    ]
                                                  },
                                                  "valueType": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "sharedProperty": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "arraySubType": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "struct",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking"
                                                    ]
                                                  },
                                                  "structFields": {
                                                    "minItems": 1,
                                                    "maxItems": 20,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "object",
                                                      "properties": {
                                                        "name": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "type": {
                                                          "type": "string",
                                                          "enum": [
                                                            "string",
                                                            "integer",
                                                            "long",
                                                            "short",
                                                            "byte",
                                                            "boolean",
                                                            "float",
                                                            "double",
                                                            "decimal",
                                                            "date",
                                                            "timestamp",
                                                            "geopoint"
                                                          ]
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 60
                                                        },
                                                        "description": {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        }
                                                      },
                                                      "required": [
                                                        "name",
                                                        "type"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "vectorDimension": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 4096
                                                  },
                                                  "derived": {
                                                    "type": "object",
                                                    "properties": {
                                                      "linkPath": {
                                                        "minItems": 1,
                                                        "maxItems": 3,
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "maxLength": 120,
                                                          "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
                                                        }
                                                      },
                                                      "selection": {
                                                        "type": "string",
                                                        "maxLength": 64,
                                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                      },
                                                      "aggregation": {
                                                        "type": "object",
                                                        "properties": {
                                                          "type": {
                                                            "type": "string",
                                                            "enum": [
                                                              "count",
                                                              "sum",
                                                              "avg",
                                                              "min",
                                                              "max",
                                                              "approximateCardinality",
                                                              "exactCardinality",
                                                              "collectList",
                                                              "collectSet"
                                                            ]
                                                          },
                                                          "property": {
                                                            "type": "string",
                                                            "maxLength": 64,
                                                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                          },
                                                          "limit": {
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 100
                                                          }
                                                        },
                                                        "required": [
                                                          "type"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "required": [
                                                      "linkPath"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  "valueFormatting": {
                                                    "type": "object",
                                                    "properties": {
                                                      "number": {
                                                        "type": "object",
                                                        "properties": {
                                                          "type": {
                                                            "type": "string",
                                                            "enum": [
                                                              "standard",
                                                              "percentage",
                                                              "currency",
                                                              "unit",
                                                              "basisPoint",
                                                              "compact"
                                                            ]
                                                          },
                                                          "currencyCode": {
                                                            "type": "string",
                                                            "pattern": "^[A-Z]{3}$"
                                                          },
                                                          "unit": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 16
                                                          },
                                                          "minimumFractionDigits": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 10
                                                          },
                                                          "maximumFractionDigits": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 10
                                                          }
                                                        },
                                                        "required": [
                                                          "type"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "date": {
                                                        "type": "object",
                                                        "properties": {
                                                          "format": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 40
                                                          }
                                                        },
                                                        "required": [
                                                          "format"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "timestamp": {
                                                        "type": "object",
                                                        "properties": {
                                                          "format": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 40
                                                          },
                                                          "zoneId": {
                                                            "type": "string",
                                                            "maxLength": 40
                                                          }
                                                        },
                                                        "required": [
                                                          "format"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      "boolean": {
                                                        "type": "object",
                                                        "properties": {
                                                          "trueValue": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 20
                                                          },
                                                          "falseValue": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 20
                                                          }
                                                        },
                                                        "required": [
                                                          "trueValue",
                                                          "falseValue"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  "typeClasses": {
                                                    "maxItems": 10,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 40
                                                        },
                                                        "name": {
                                                          "type": "string",
                                                          "minLength": 1,
                                                          "maxLength": 80
                                                        }
                                                      },
                                                      "required": [
                                                        "kind",
                                                        "name"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "type"
                                                ]
                                              }
                                            },
                                            "apiNameAtoB": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                            },
                                            "apiNameBtoA": {
                                              "type": "string",
                                              "maxLength": 64,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                            },
                                            "displayNameAtoB": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 120
                                            },
                                            "displayNameBtoA": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 120
                                            },
                                            "foreignKey": {
                                              "type": "object",
                                              "properties": {
                                                "side": {
                                                  "type": "string",
                                                  "enum": [
                                                    "from",
                                                    "to"
                                                  ]
                                                },
                                                "property": {
                                                  "type": "string",
                                                  "maxLength": 64,
                                                  "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                }
                                              },
                                              "required": [
                                                "side",
                                                "property"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "status": {
                                              "type": "string",
                                              "enum": [
                                                "ACTIVE",
                                                "EXPERIMENTAL",
                                                "DEPRECATED",
                                                "EXAMPLE"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "from",
                                            "to"
                                          ]
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "action"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "objectType": {
                                              "type": "string",
                                              "maxLength": 80,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                            },
                                            "operation": {
                                              "type": "string",
                                              "enum": [
                                                "modify",
                                                "create",
                                                "delete"
                                              ]
                                            },
                                            "parameters": {
                                              "default": [],
                                              "maxItems": 24,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "maxLength": 64,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "array",
                                                      "struct",
                                                      "vector",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "timeseries",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking",
                                                      "text",
                                                      "real",
                                                      "numeric",
                                                      "json",
                                                      "object",
                                                      "objectSet",
                                                      "interfaceObject"
                                                    ]
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "description": {
                                                    "type": "string",
                                                    "maxLength": 200
                                                  },
                                                  "required": {
                                                    "type": "boolean"
                                                  },
                                                  "enumRef": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "valueType": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "objectType": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "interfaceType": {
                                                    "type": "string",
                                                    "maxLength": 80,
                                                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                  },
                                                  "arraySubType": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "struct",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking",
                                                      "object"
                                                    ]
                                                  },
                                                  "maxLength": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 20000
                                                  },
                                                  "min": {
                                                    "type": "number"
                                                  },
                                                  "max": {
                                                    "type": "number"
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "type"
                                                ]
                                              }
                                            },
                                            "edits": {
                                              "default": {},
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                                              },
                                              "additionalProperties": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            },
                                            "rules": {
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "oneOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "createObject"
                                                      },
                                                      "objectType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "values": {
                                                        "default": {},
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "additionalProperties": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "objectType"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "modifyObject"
                                                      },
                                                      "objectType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "object": {
                                                        "type": "string",
                                                        "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                                      },
                                                      "values": {
                                                        "default": {},
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "additionalProperties": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "objectType",
                                                      "object"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "createOrModifyObject"
                                                      },
                                                      "objectType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "values": {
                                                        "default": {},
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "additionalProperties": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "objectType"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "deleteObject"
                                                      },
                                                      "objectType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "object": {
                                                        "type": "string",
                                                        "pattern": "^\\$[A-Za-z][A-Za-z0-9_]*$"
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "objectType",
                                                      "object"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "createLink"
                                                      },
                                                      "linkType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "a": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "b": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "linkType",
                                                      "a",
                                                      "b"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "deleteLink"
                                                      },
                                                      "linkType": {
                                                        "type": "string",
                                                        "maxLength": 80,
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                      },
                                                      "a": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "b": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "linkType",
                                                      "a",
                                                      "b"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              }
                                            },
                                            "submissionCriteria": {
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "condition": {
                                                    "$ref": "#/$defs/__schema1"
                                                  },
                                                  "failureMessage": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 300
                                                  }
                                                },
                                                "required": [
                                                  "condition",
                                                  "failureMessage"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "roles": {
                                              "minItems": 1,
                                              "maxItems": 3,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "developer",
                                                  "member",
                                                  "editor"
                                                ]
                                              }
                                            },
                                            "summary": {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            "actionLog": {
                                              "type": "boolean"
                                            },
                                            "toolDescription": {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            "webhooks": {
                                              "type": "object",
                                              "properties": {
                                                "writeback": {
                                                  "type": "object",
                                                  "properties": {
                                                    "webhook": {
                                                      "type": "string",
                                                      "pattern": "^[a-z][a-z0-9-]{1,31}\\/[a-z][a-z0-9-]{1,63}$"
                                                    },
                                                    "inputs": {
                                                      "default": {},
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string",
                                                        "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                                                      },
                                                      "additionalProperties": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "webhook"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "interface"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "properties": {
                                              "default": {},
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string",
                                                "maxLength": 80,
                                                "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                              },
                                              "additionalProperties": {
                                                "type": "object",
                                                "properties": {
                                                  "required": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "localProperties": {
                                              "default": {},
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                                              },
                                              "additionalProperties": {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "array",
                                                      "struct",
                                                      "vector",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "timeseries",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking",
                                                      "text",
                                                      "real",
                                                      "numeric",
                                                      "json"
                                                    ]
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "description": {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  "required": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "arraySubType": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "struct",
                                                      "geopoint",
                                                      "geoshape",
                                                      "attachment",
                                                      "mediaReference",
                                                      "geotimeSeriesReference",
                                                      "cipherText",
                                                      "marking"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "type"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "extendsInterfaces": {
                                              "default": [],
                                              "maxItems": 10,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "maxLength": 80,
                                                "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                              }
                                            },
                                            "links": {
                                              "default": {},
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                                              },
                                              "additionalProperties": {
                                                "type": "object",
                                                "properties": {
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "description": {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  "linkedEntity": {
                                                    "anyOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "objectType": {
                                                            "type": "string",
                                                            "maxLength": 80,
                                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                          }
                                                        },
                                                        "required": [
                                                          "objectType"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "interfaceType": {
                                                            "type": "string",
                                                            "maxLength": 80,
                                                            "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                          }
                                                        },
                                                        "required": [
                                                          "interfaceType"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "cardinality": {
                                                    "type": "string",
                                                    "enum": [
                                                      "ONE",
                                                      "MANY"
                                                    ]
                                                  },
                                                  "required": {
                                                    "default": false,
                                                    "type": "boolean"
                                                  }
                                                },
                                                "required": [
                                                  "linkedEntity",
                                                  "cardinality"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "icon": {
                                              "type": "object",
                                              "properties": {
                                                "blueprint": {
                                                  "type": "object",
                                                  "properties": {
                                                    "name": {
                                                      "type": "string",
                                                      "pattern": "^[a-z0-9-]{1,40}$"
                                                    },
                                                    "color": {
                                                      "type": "string",
                                                      "pattern": "^#[0-9A-Fa-f]{6}$"
                                                    }
                                                  },
                                                  "required": [
                                                    "name",
                                                    "color"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "blueprint"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "sharedProperty"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "array",
                                                "struct",
                                                "vector",
                                                "geopoint",
                                                "geoshape",
                                                "attachment",
                                                "mediaReference",
                                                "timeseries",
                                                "geotimeSeriesReference",
                                                "cipherText",
                                                "marking",
                                                "text",
                                                "real",
                                                "numeric",
                                                "json"
                                              ]
                                            },
                                            "arraySubType": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "struct",
                                                "geopoint",
                                                "geoshape",
                                                "attachment",
                                                "mediaReference",
                                                "geotimeSeriesReference",
                                                "cipherText",
                                                "marking"
                                              ]
                                            },
                                            "structFields": {
                                              "minItems": 1,
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "maxLength": 64,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "geopoint"
                                                    ]
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "description": {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "type"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "vectorDimension": {
                                              "type": "integer",
                                              "minimum": 1,
                                              "maximum": 4096
                                            },
                                            "valueType": {
                                              "type": "string",
                                              "maxLength": 80,
                                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                            },
                                            "unit": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 16
                                            },
                                            "synonyms": {
                                              "maxItems": 12,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 40
                                              }
                                            },
                                            "valueFormatting": {
                                              "type": "object",
                                              "properties": {
                                                "number": {
                                                  "type": "object",
                                                  "properties": {
                                                    "type": {
                                                      "type": "string",
                                                      "enum": [
                                                        "standard",
                                                        "percentage",
                                                        "currency",
                                                        "unit",
                                                        "basisPoint",
                                                        "compact"
                                                      ]
                                                    },
                                                    "currencyCode": {
                                                      "type": "string",
                                                      "pattern": "^[A-Z]{3}$"
                                                    },
                                                    "unit": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 16
                                                    },
                                                    "minimumFractionDigits": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 10
                                                    },
                                                    "maximumFractionDigits": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 10
                                                    }
                                                  },
                                                  "required": [
                                                    "type"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "date": {
                                                  "type": "object",
                                                  "properties": {
                                                    "format": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 40
                                                    }
                                                  },
                                                  "required": [
                                                    "format"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "timestamp": {
                                                  "type": "object",
                                                  "properties": {
                                                    "format": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 40
                                                    },
                                                    "zoneId": {
                                                      "type": "string",
                                                      "maxLength": 40
                                                    }
                                                  },
                                                  "required": [
                                                    "format"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "boolean": {
                                                  "type": "object",
                                                  "properties": {
                                                    "trueValue": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 20
                                                    },
                                                    "falseValue": {
                                                      "type": "string",
                                                      "minLength": 1,
                                                      "maxLength": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "trueValue",
                                                    "falseValue"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "visibility": {
                                              "type": "string",
                                              "enum": [
                                                "NORMAL",
                                                "PROMINENT",
                                                "HIDDEN"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ]
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "valueType"
                                        },
                                        "schema": {
                                          "type": "object",
                                          "properties": {
                                            "baseType": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "array",
                                                "struct"
                                              ]
                                            },
                                            "arraySubType": {
                                              "type": "string",
                                              "enum": [
                                                "string",
                                                "integer",
                                                "long",
                                                "short",
                                                "byte",
                                                "boolean",
                                                "float",
                                                "double",
                                                "decimal",
                                                "date",
                                                "timestamp",
                                                "struct",
                                                "geopoint",
                                                "geoshape",
                                                "attachment",
                                                "mediaReference",
                                                "geotimeSeriesReference",
                                                "cipherText",
                                                "marking"
                                              ]
                                            },
                                            "structFields": {
                                              "minItems": 1,
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "name": {
                                                    "type": "string",
                                                    "maxLength": 64,
                                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                  },
                                                  "type": {
                                                    "type": "string",
                                                    "enum": [
                                                      "string",
                                                      "integer",
                                                      "long",
                                                      "short",
                                                      "byte",
                                                      "boolean",
                                                      "float",
                                                      "double",
                                                      "decimal",
                                                      "date",
                                                      "timestamp",
                                                      "geopoint"
                                                    ]
                                                  },
                                                  "title": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 60
                                                  },
                                                  "description": {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  }
                                                },
                                                "required": [
                                                  "name",
                                                  "type"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "constraints": {
                                              "default": [],
                                              "maxItems": 10,
                                              "type": "array",
                                              "items": {
                                                "oneOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "enum"
                                                      },
                                                      "options": {
                                                        "minItems": 1,
                                                        "maxItems": 500,
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 200
                                                            },
                                                            {
                                                              "type": "number"
                                                            }
                                                          ]
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "options"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "range"
                                                      },
                                                      "minimumValue": {
                                                        "anyOf": [
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "string",
                                                            "maxLength": 40
                                                          }
                                                        ]
                                                      },
                                                      "maximumValue": {
                                                        "anyOf": [
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "string",
                                                            "maxLength": 40
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "type"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "length"
                                                      },
                                                      "minimumLength": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 100000
                                                      },
                                                      "maximumLength": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 100000
                                                      }
                                                    },
                                                    "required": [
                                                      "type"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "regex"
                                                      },
                                                      "pattern": {
                                                        "type": "string",
                                                        "minLength": 1,
                                                        "maxLength": 500
                                                      },
                                                      "partialMatch": {
                                                        "default": false,
                                                        "type": "boolean"
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "pattern"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "uuid"
                                                      }
                                                    },
                                                    "required": [
                                                      "type"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "rid"
                                                      }
                                                    },
                                                    "required": [
                                                      "type"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "array"
                                                      },
                                                      "minimumSize": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 10000
                                                      },
                                                      "maximumSize": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 10000
                                                      },
                                                      "uniqueValues": {
                                                        "default": false,
                                                        "type": "boolean"
                                                      }
                                                    },
                                                    "required": [
                                                      "type"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "type": {
                                                        "type": "string",
                                                        "const": "struct"
                                                      },
                                                      "properties": {
                                                        "type": "object",
                                                        "propertyNames": {
                                                          "type": "string",
                                                          "maxLength": 64,
                                                          "pattern": "^[a-z][A-Za-z0-9_]*$"
                                                        },
                                                        "additionalProperties": {
                                                          "type": "string",
                                                          "maxLength": 80,
                                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "type",
                                                      "properties"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              }
                                            },
                                            "version": {
                                              "default": "1.0.0",
                                              "type": "string",
                                              "pattern": "^\\d+\\.\\d+\\.\\d+$"
                                            }
                                          },
                                          "required": [
                                            "baseType"
                                          ]
                                        },
                                        "apiName": {
                                          "type": "string",
                                          "maxLength": 80,
                                          "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "description": {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        "layer": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department"
                                          ]
                                        },
                                        "department": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "ownerAgentId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "source": {
                                          "type": "string",
                                          "enum": [
                                            "promoted",
                                            "inferred",
                                            "custom"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "active",
                                            "experimental",
                                            "deprecated",
                                            "example"
                                          ]
                                        },
                                        "accessLevel": {
                                          "type": "string",
                                          "enum": [
                                            "company",
                                            "department",
                                            "group"
                                          ]
                                        },
                                        "visibility": {
                                          "type": "string",
                                          "enum": [
                                            "members",
                                            "public"
                                          ]
                                        },
                                        "allowedConsumerDepts": {
                                          "maxItems": 50,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 80
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schema",
                                        "apiName",
                                        "title"
                                      ]
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "op"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "request": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "request"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "evidence": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "feedback",
                            "action",
                            "usage",
                            "error",
                            "file",
                            "skill",
                            "conversation",
                            "data"
                          ]
                        },
                        "ref": {
                          "type": "string",
                          "maxLength": 120
                        },
                        "excerpt": {
                          "type": "string",
                          "maxLength": 600
                        }
                      },
                      "required": [
                        "kind",
                        "excerpt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "feedback": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  }
                },
                "required": [
                  "target",
                  "title",
                  "rationale"
                ],
                "additionalProperties": false,
                "$defs": {
                  "__schema0": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema0"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "and"
                          },
                          "and": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "and"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "or"
                          },
                          "or": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "$ref": "#/$defs/__schema0"
                                }
                              }
                            },
                            "required": [
                              "conditions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "or"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "not": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            "required": [
                              "condition"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "not"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "true"
                          },
                          "true": {
                            "type": "object",
                            "properties": {},
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "true"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "group"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "type",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "groupProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markingProperty"
                          },
                          "property": {
                            "type": "string",
                            "maxLength": 64,
                            "pattern": "^[a-z][A-Za-z0-9_]*$"
                          }
                        },
                        "required": [
                          "type",
                          "property"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "markings"
                          },
                          "markings": {
                            "type": "object",
                            "properties": {
                              "property": {
                                "type": "string",
                                "maxLength": 64,
                                "pattern": "^[a-z][A-Za-z0-9_]*$"
                              }
                            },
                            "required": [
                              "property"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "markings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "constantMarkings"
                          },
                          "constantMarkings": {
                            "type": "object",
                            "properties": {
                              "markings": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                                }
                              },
                              "markingType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "markings",
                              "markingType"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "constantMarkings"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "comparison": {
                            "type": "object",
                            "properties": {
                              "operator": {
                                "type": "string",
                                "enum": [
                                  "EQUAL",
                                  "INTERSECTS",
                                  "SUBSET_OF",
                                  "SUPERSET_OF"
                                ]
                              },
                              "left": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "right": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "constant"
                                      },
                                      "constant": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "string"
                                              },
                                              "string": {
                                                "type": "string",
                                                "maxLength": 200
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "string"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "boolean"
                                              },
                                              "boolean": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "boolean"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "strings"
                                              },
                                              "strings": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 200
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "strings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "constant"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "property": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "pattern": "^[a-z][A-Za-z0-9_]*$"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "property"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "userProperty"
                                      },
                                      "userProperty": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userId"
                                              },
                                              "userId": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "username"
                                              },
                                              "username": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "username"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupIds"
                                              },
                                              "groupIds": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "groupNames"
                                              },
                                              "groupNames": {
                                                "type": "object",
                                                "properties": {
                                                  "realm": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 40
                                                  },
                                                  "parentGroupId": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "groupNames"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "userAttributes"
                                              },
                                              "userAttributes": {
                                                "type": "object",
                                                "properties": {
                                                  "attributeKey": {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 80
                                                  }
                                                },
                                                "required": [
                                                  "attributeKey"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "userAttributes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "userProperty"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "operator",
                              "left",
                              "right"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "type",
                          "comparison"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "__schema1": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "comparison"
                          },
                          "left": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "is",
                              "isNot",
                              "matches",
                              "lt",
                              "lte",
                              "gt",
                              "gte",
                              "includes",
                              "includesAny",
                              "isIncludedIn",
                              "eachIs",
                              "eachIsNot",
                              "isNull",
                              "isNotNull"
                            ]
                          },
                          "right": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "param": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "property": {
                                    "type": "string",
                                    "pattern": "^[a-z][A-Za-z0-9_]*$"
                                  }
                                },
                                "required": [
                                  "param"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "user": {
                                    "type": "string",
                                    "enum": [
                                      "id",
                                      "name",
                                      "role"
                                    ]
                                  }
                                },
                                "required": [
                                  "user"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "literal": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "number"
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "literal"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "left",
                          "operator"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          "conditions": {
                            "minItems": 1,
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema1"
                            }
                          }
                        },
                        "required": [
                          "type",
                          "conditions"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "not"
                          },
                          "condition": {
                            "$ref": "#/$defs/__schema1"
                          }
                        },
                        "required": [
                          "type",
                          "condition"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/proposals/{id}": {
      "patch": {
        "operationId": "v1.developer.evolve.proposals.decide",
        "summary": "Accept or reject a proposal (rejecting returns linked feedback to open).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found",
          "proposal_applied",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "reject"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "decision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/proposals/{id}/apply": {
      "post": {
        "operationId": "v1.developer.evolve.proposals.apply",
        "summary": "Apply a proposal: semantic → patch the definitions (closure-checked) and publish a new semantic version (appliedRef = vN); app → record the app version that implements it. Linked feedback becomes done.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found",
          "proposal_applied",
          "proposal_rejected",
          "gate_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/suggest": {
      "post": {
        "operationId": "v1.developer.evolve.suggest",
        "summary": "Draft proposals with a model: evidence + the caller's files, skills (SKILL.md) and conversation excerpts → structured proposals saved as open. Billed to the caller's company like the model SDK.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "model_not_found",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "app": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,47}$"
                  },
                  "types": {
                    "default": [],
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                    }
                  },
                  "files": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        }
                      },
                      "required": [
                        "name",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "skills": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        }
                      },
                      "required": [
                        "name",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "conversations": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        }
                      },
                      "required": [
                        "name",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "max": {
                    "default": 5,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "days": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/apps/{slug}/overlay": {
      "get": {
        "operationId": "v1.developer.evolve.apps.overlay",
        "summary": "Self-evolution SDK, in-app improvements: the overlay the caller sees on the app's current version — app-wide improvements then the caller's own, folded into CSS + text changes (digest = ETag; ?since=<digest> answers changed=false; ?scope=app = app-wide only, for baking).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/apps/{slug}/compile": {
      "post": {
        "operationId": "v1.developer.evolve.apps.compile",
        "summary": "Compile one sentence (\"make the chat bigger\") into improvement ops for live preview: quick intents are parsed locally (no model), the rest go to the app's evolve model (billed to the app, counted in compute minutes). Ops are validated against the version's surface (declared slots + tokens). Nothing is stored.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "model_not_found",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "request": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "slot": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{0,39}$"
                  },
                  "thread": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "role",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "draft": {
                    "default": [],
                    "maxItems": 24,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "token"
                            },
                            "name": {
                              "type": "string",
                              "pattern": "^--[a-z][a-z0-9-]{0,47}$"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 120
                            }
                          },
                          "required": [
                            "op",
                            "name",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "style"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "set": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 40
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "number"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "set"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "text"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "text": {
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "attr"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "name": {
                              "type": "string",
                              "enum": [
                                "placeholder",
                                "title",
                                "aria-label"
                              ]
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "name",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "reset"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "props": {
                              "maxItems": 12,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "maxLength": 40
                              }
                            }
                          },
                          "required": [
                            "op",
                            "slot"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "surface": {
                    "default": {
                      "slots": [],
                      "tokens": {}
                    },
                    "type": "object",
                    "properties": {
                      "slots": {
                        "default": [],
                        "maxItems": 61,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "count": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            },
                            "width": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100000
                            },
                            "fontSize": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 500
                            },
                            "zoom": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 10
                            },
                            "styles": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 40
                              },
                              "additionalProperties": {
                                "type": "string",
                                "maxLength": 120
                              }
                            },
                            "text": {
                              "type": "string",
                              "maxLength": 120
                            }
                          },
                          "required": [
                            "name"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "tokens": {
                        "default": {},
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^--[a-z][a-z0-9-]{0,47}$"
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 120
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "width": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100000
                          },
                          "height": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100000
                          }
                        },
                        "required": [
                          "width",
                          "height"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "deepseek-flash",
                      "gpt-5.4-mini"
                    ]
                  }
                },
                "required": [
                  "request"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/apps/{slug}/improvements": {
      "get": {
        "operationId": "v1.developer.evolve.apps.improvements.list",
        "summary": "Improvement projects of an app (?status=live|proposed|rejected|reverted&scope=personal|app&kind=overlay|request&mine=1&limit=): developers see all, others see app-wide + their own; each row carries summary, bakedIn, orphaned and what the caller can do.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "invalid_query"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.evolve.apps.improvements.create",
        "summary": "Save an improvement project (idempotent by clientKey; x-aidc-dry-run previews). overlay: personal = live for the author; app = live for everyone when a developer saves it, otherwise proposed (live for the author). request: needs code — also creates an app proposal (the evidence & proposals half of the SDK). Returns the caller's new overlay.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "malformed_json",
          "invalid_payload",
          "payload_too_large",
          "idempotency_conflict",
          "improvement_limit"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "default": "overlay",
                    "type": "string",
                    "enum": [
                      "overlay",
                      "request"
                    ]
                  },
                  "scope": {
                    "default": "personal",
                    "type": "string",
                    "enum": [
                      "personal",
                      "app"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "thread": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "role",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "ops": {
                    "default": [],
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "token"
                            },
                            "name": {
                              "type": "string",
                              "pattern": "^--[a-z][a-z0-9-]{0,47}$"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 120
                            }
                          },
                          "required": [
                            "op",
                            "name",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "style"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "set": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 40
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "number"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "set"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "text"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "text": {
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "attr"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "name": {
                              "type": "string",
                              "enum": [
                                "placeholder",
                                "title",
                                "aria-label"
                              ]
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "required": [
                            "op",
                            "slot",
                            "name",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "const": "reset"
                            },
                            "slot": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9-]{0,39}$"
                            },
                            "props": {
                              "maxItems": 12,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "maxLength": 40
                              }
                            }
                          },
                          "required": [
                            "op",
                            "slot"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "clientKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
                  }
                },
                "required": [
                  "title",
                  "thread"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/apps/{slug}/improvements/{id}": {
      "patch": {
        "operationId": "v1.developer.evolve.apps.improvements.decide",
        "summary": "Decide an improvement: propose (author: personal → everyone), adopt / reject (developers; a rejected overlay stays live for its author), revert. Guarded against concurrent decisions; x-aidc-dry-run previews. Returns the caller's new overlay.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "resource_not_found",
          "improvement_limit",
          "improvement_state",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "propose",
                      "adopt",
                      "reject",
                      "revert"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "action"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/improve/{namespace}/evidence": {
      "get": {
        "operationId": "v1.developer.improve.evidence",
        "summary": "Deprecated alias of GET /api/v1/developer/evolve/{namespace}/evidence (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/improve/{namespace}/proposals": {
      "get": {
        "operationId": "v1.developer.improve.proposals.list",
        "summary": "Deprecated alias of GET /api/v1/developer/evolve/{namespace}/proposals (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_query"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.improve.proposals.create",
        "summary": "Deprecated alias of POST /api/v1/developer/evolve/{namespace}/proposals (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/improve/{namespace}/proposals/{id}": {
      "patch": {
        "operationId": "v1.developer.improve.proposals.decide",
        "summary": "Deprecated alias of PATCH /api/v1/developer/evolve/{namespace}/proposals/{id} (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found",
          "proposal_applied",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/improve/{namespace}/proposals/{id}/apply": {
      "post": {
        "operationId": "v1.developer.improve.proposals.apply",
        "summary": "Deprecated alias of POST /api/v1/developer/evolve/{namespace}/proposals/{id}/apply (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "resource_not_found",
          "proposal_applied",
          "proposal_rejected",
          "gate_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/improve/{namespace}/suggest": {
      "post": {
        "operationId": "v1.developer.improve.suggest",
        "summary": "Deprecated alias of POST /api/v1/developer/evolve/{namespace}/suggest (the self-improvement SDK was merged into the self-evolution SDK in 1.22.0): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "model_not_found",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/{slug}/overlay": {
      "get": {
        "operationId": "v1.developer.evolve.overlay",
        "summary": "Deprecated alias of GET /api/v1/developer/evolve/{namespace}/apps/{slug}/overlay (the in-app improvements moved under /apps/{slug} in 1.22.0 so the path cannot clash with an app named proposals / evidence / suggest): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/{slug}/compile": {
      "post": {
        "operationId": "v1.developer.evolve.compile",
        "summary": "Deprecated alias of POST /api/v1/developer/evolve/{namespace}/apps/{slug}/compile (the in-app improvements moved under /apps/{slug} in 1.22.0 so the path cannot clash with an app named proposals / evidence / suggest): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "model_not_found",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/{slug}/improvements": {
      "get": {
        "operationId": "v1.developer.evolve.improvements.list",
        "summary": "Deprecated alias of GET /api/v1/developer/evolve/{namespace}/apps/{slug}/improvements (the in-app improvements moved under /apps/{slug} in 1.22.0 so the path cannot clash with an app named proposals / evidence / suggest): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "invalid_query"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.evolve.improvements.create",
        "summary": "Deprecated alias of POST /api/v1/developer/evolve/{namespace}/apps/{slug}/improvements (the in-app improvements moved under /apps/{slug} in 1.22.0 so the path cannot clash with an app named proposals / evidence / suggest): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "malformed_json",
          "invalid_payload",
          "payload_too_large",
          "idempotency_conflict",
          "improvement_limit"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/evolve/{namespace}/{slug}/improvements/{id}": {
      "patch": {
        "operationId": "v1.developer.evolve.improvements.decide",
        "summary": "Deprecated alias of PATCH /api/v1/developer/evolve/{namespace}/apps/{slug}/improvements/{id} (the in-app improvements moved under /apps/{slug} in 1.22.0 so the path cannot clash with an app named proposals / evidence / suggest): same request and response, plus Deprecation and Link headers.",
        "deprecated": true,
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "app_not_found",
          "evolve_not_enabled",
          "resource_not_found",
          "improvement_limit",
          "improvement_state",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/workflows/{namespace}": {
      "get": {
        "operationId": "v1.developer.workflows.list",
        "summary": "Workflows of the company (apps whose manifest has a workflow): steps, triggers (manual / data change), live and test versions, the latest run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/workflows/{namespace}/{slug}": {
      "get": {
        "operationId": "v1.developer.workflows.get",
        "summary": "Workflow detail for the canvas: plan (topological levels), every step (capability used and its provider app, compute fields, model prompt), swim lanes by department, and the provider apps' cards. ?channel=test|production (default: the ticket's channel, production for developer keys). The workflow app's own ticket may read it whatever the role (a shared canvas shows only this workflow).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "invalid_query",
          "workflow_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/workflows/{namespace}/{slug}/runs": {
      "get": {
        "operationId": "v1.developer.workflows.runs.list",
        "summary": "Recent runs of a workflow (summary: status, trigger, per-step status and duration).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.workflows.runs.start",
        "summary": "Start a run: returns the run at once (202) and executes after the response; follow …/runs/{id}/events. mode = run (actions write the semantic layer) | preview (reads, computations and model analysis run, actions only return their plan). Developer keys may run any workflow of the company on either channel; app tickets only in the workflow's own app — roles in trigger.manual.roles run, company members preview, and signed-in visitors of a public share preview when trigger.manual.preview = public. Idempotency-Key returns the same run (200). Supports dry-run (validates input, returns the plan).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "workflow_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "additionalProperties": {}
                  },
                  "mode": {
                    "default": "run",
                    "type": "string",
                    "enum": [
                      "run",
                      "preview"
                    ]
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "production",
                      "test"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/workflows/{namespace}/{slug}/runs/{id}": {
      "get": {
        "operationId": "v1.developer.workflows.runs.get",
        "summary": "One run: every step's status, duration, output (clipped to 200 rows / 48 KB), error; the final output and tokens used.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "run_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/workflows/{namespace}/{slug}/runs/{id}/events": {
      "get": {
        "operationId": "v1.developer.workflows.runs.events",
        "summary": "Live progress of a run (SSE): event run (the whole run, pushed whenever a step changes) → event done. Reconnects after ~280 s.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "run_not_found",
          "quota_exhausted"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/capabilities/{namespace}": {
      "get": {
        "operationId": "v1.developer.capabilities.list",
        "summary": "Capability catalog (workflow SDK): what every app published to production offers — capabilities declared in manifest exports and the ones auto-extracted from the semantic types / actions it registered (auto = true). Workflows reference them as <app slug>/<capability name>.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/card": {
      "get": {
        "operationId": "v1.developer.apps.card",
        "summary": "App Card: owner department, versions, SDKs (declared vs detected at deploy), data connections (semantic-layer types read / written and actions, streams with publisher status, models, datasets), capabilities exported / auto-extracted / used, access and shares, last 7 days usage. Generated by the platform from the manifest and deploy analysis — metadata only. Cards of public apps are readable anonymously (rate-limited per IP).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/usage": {
      "get": {
        "operationId": "v1.developer.apps.usage",
        "summary": "Resource usage of an app: compute minutes this UTC month (SSE connection time, workflow runs, model / transcription calls) by kind against limits.computeMinutesPerMonth (default 2000; exhausted = app-ticket requests get 429 quota_exhausted until the 1st), all effective limits, the registered workflow schedule (next / last run), today's notifications by status (sent / suppressed / unconfigured / failed) with the 10 most recent, and whether the email channel is configured. Developer key of the company (platform staff also for public apps) or the app's own ticket.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found",
          "quota_exhausted"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/apis": {
      "get": {
        "operationId": "v1.developer.apps.apis.list",
        "summary": "The app's APIs (developer/docs/apps.md — an app is a plugin-style bundle of skills and APIs, UI optional): every API agents and programs can call — capabilities declared in manifest exports, capabilities auto-extracted from its semantic types / actions, and run / get_run / list_runs for workflow apps — with title, description, input JSON Schema (write APIs add preview), output, the execute URL and the CLI line; plus the app's skills (bundle skills/<name>/SKILL.md, or one generated from the manifest), example prompts and the AIDC capabilities its UI uses. Public apps are readable anonymously (rate-limited per IP); company apps need a credential of the company (member or above). ?channel=test for developers.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/apis/{name}/execute": {
      "post": {
        "operationId": "v1.developer.apps.apis.execute",
        "summary": "Call one API of an app — the same door for every API: exports and auto-extracted capabilities run as the provider app with the member role (the caller never gets more than the app may read or do; the caller is recorded), workflow apps also take run (starts a run, 202; Idempotency-Key replays the same run), get_run (input.id) and list_runs. preview = true: reads and computations run, writes (actions, a real run) only return their plan. Developer keys call any app of the company (channel test allowed); app tickets only their own app. Supports dry-run (validates the input, returns the plan).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found",
          "capability_not_found",
          "run_not_found",
          "resource_not_found",
          "version_conflict",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional for run: repeating the same key returns the same run (8–128 chars [A-Za-z0-9_.:-]).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "additionalProperties": {}
                  },
                  "preview": {
                    "default": false,
                    "type": "boolean"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "test",
                      "production"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/about": {
      "get": {
        "operationId": "v1.developer.apps.about",
        "summary": "The app's description for agents (the same Markdown as <app URL>/about.md): what it is, how to sign in, its APIs with CLI and HTTP, the full text of its skills, example prompts and ground rules — plus the one-line prompt the app page copies for agents. Public apps are readable anonymously (rate-limited per IP); company apps need a credential of the company (member or above). ?channel=test for developers.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/metadata": {
      "get": {
        "operationId": "v1.developer.oauth.metadata",
        "summary": "AIDC MCP OAuth 2.1 metadata.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/resource": {
      "get": {
        "operationId": "v1.developer.oauth.resource",
        "summary": "AIDC MCP OAuth 2.1 resource.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/register": {
      "post": {
        "operationId": "v1.developer.oauth.register",
        "summary": "AIDC MCP OAuth 2.1 register.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_name": {
                    "default": "MCP client",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "redirect_uris": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri"
                    }
                  },
                  "token_endpoint_auth_method": {
                    "default": "none",
                    "type": "string",
                    "const": "none"
                  },
                  "grant_types": {
                    "default": [
                      "authorization_code",
                      "refresh_token"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "authorization_code",
                        "refresh_token"
                      ]
                    }
                  },
                  "response_types": {
                    "default": [
                      "code"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "const": "code"
                    }
                  }
                },
                "required": [
                  "redirect_uris"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/decision": {
      "post": {
        "operationId": "v1.developer.oauth.decision",
        "summary": "AIDC account consent for optional MCP OAuth. Requires the first-party session and CSRF validation.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "authorization": {
                    "type": "object",
                    "properties": {
                      "response_type": {
                        "type": "string",
                        "const": "code"
                      },
                      "client_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "redirect_uri": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      },
                      "resource": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      },
                      "scope": {
                        "default": "apps:read apps:write",
                        "type": "string",
                        "maxLength": 100
                      },
                      "state": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1024
                      },
                      "code_challenge": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{43}$"
                      },
                      "code_challenge_method": {
                        "type": "string",
                        "const": "S256"
                      }
                    },
                    "required": [
                      "response_type",
                      "client_id",
                      "redirect_uri",
                      "resource",
                      "state",
                      "code_challenge",
                      "code_challenge_method"
                    ]
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "deny"
                    ]
                  },
                  "cellId": {
                    "type": "string",
                    "pattern": "^(public|cell-[a-z0-9][a-z0-9-]{1,62})$"
                  }
                },
                "required": [
                  "authorization",
                  "decision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/token": {
      "post": {
        "operationId": "v1.developer.oauth.token",
        "summary": "AIDC MCP OAuth 2.1 token.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "grant_type": {
                        "type": "string",
                        "const": "authorization_code"
                      },
                      "client_id": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "redirect_uri": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      },
                      "resource": {
                        "type": "string",
                        "format": "uri"
                      },
                      "code_verifier": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9._~-]{43,128}$"
                      }
                    },
                    "required": [
                      "grant_type",
                      "client_id",
                      "code",
                      "redirect_uri",
                      "resource",
                      "code_verifier"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "grant_type": {
                        "type": "string",
                        "const": "refresh_token"
                      },
                      "client_id": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "refresh_token": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "resource": {
                        "type": "string",
                        "format": "uri"
                      },
                      "scope": {
                        "type": "string",
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "grant_type",
                      "client_id",
                      "refresh_token",
                      "resource"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/oauth/revoke": {
      "post": {
        "operationId": "v1.developer.oauth.revoke",
        "summary": "AIDC MCP OAuth 2.1 revoke.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "client_id": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "token_type_hint": {
                    "type": "string",
                    "enum": [
                      "access_token",
                      "refresh_token"
                    ]
                  }
                },
                "required": [
                  "token",
                  "client_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OAUTH standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "OAUTH error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/creator/session": {
      "post": {
        "operationId": "v1.developer.creator.session",
        "summary": "AIDC Apps Creator first-party session actions. Default AIDC login; no OpenAI account linking. CSRF and company Developer access enforced.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "invalid_session",
          "forbidden",
          "rate_limited",
          "invalid_payload"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cellId": {
                    "type": "string",
                    "pattern": "^(public|cell-[a-z0-9][a-z0-9-]{1,62})$"
                  },
                  "name": {
                    "type": "string",
                    "enum": [
                      "get_profile",
                      "list_apps",
                      "get_sdk_docs",
                      "scaffold_app",
                      "validate_app",
                      "deploy_app",
                      "publish_app"
                    ]
                  },
                  "arguments": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "cellId",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/creator/mcp": {
      "post": {
        "operationId": "v1.developer.creator.mcp",
        "summary": "AIDC Apps Creator: SDK docs, scaffold, validation, account, test deployment and publishing. Login required: get_sdk_docs and show_creator work without login; every other tool needs an AIDC login (member or above; list, deploy and publish need developer) and returns an OAuth challenge otherwise.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    ]
                  },
                  "method": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "params": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "MCP error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "v1.developer.creator.mcp.get",
        "summary": "Stateless MCP transport; GET is not supported (405).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "405": {
            "description": "MCP standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "MCP error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/apps/{namespace}/{slug}/mcp": {
      "get": {
        "operationId": "v1.developer.apps.mcp.get",
        "summary": "Stateless MCP transport; GET is not supported (405).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "405": {
            "description": "MCP standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "MCP error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.apps.mcp",
        "summary": "The app's MCP server (Model Context Protocol, Streamable HTTP; stateless, JSON responses only, no SSE stream). tools = the app's APIs (dots in names become __; write tools take preview), prompts = the app's skills (prompts/get returns SKILL.md). Methods: initialize, ping, tools/list, tools/call, prompts/list, prompts/get, skills/list, skills/get, resources/list, resources/read; notifications return 202. Tool calls go through the same door as …/apis/{name}/execute (app × member role). Login required: no credential → 401 with WWW-Authenticate (official apps too). Credential: Bearer login key (developer: any app of the company, ?channel=test; member: bound to this app as if opening it in the browser — production only, access policy applies), application ticket, or AIDC OAuth token bound to this resource. Registered JSON-RPC exception to the envelope rule.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "app_not_found",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    ]
                  },
                  "method": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "params": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP standard response (no AIDC envelope).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "MCP error or HTTP authorization failure.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/notify/test": {
      "post": {
        "operationId": "v1.developer.notify.test",
        "summary": "Verify the email channel of workflow notify steps: sends a test email to the developer key holder's own verified address through the same path as notify steps (recipient check, outbox record). Returns status sent | unconfigured (RESEND_API_KEY not set) | failed | suppressed. 3 per 10 minutes per account. Supports x-aidc-dry-run (returns the plan: recipient, sender, channel).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "rate_limited"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/registry": {
      "get": {
        "operationId": "v1.developer.registry",
        "summary": "App registry: every Nexus app of the company — declared SDKs vs SDKs actually imported (static analysis at deploy), semantic types / actions / streams / models it uses, who may open it, test and production versions, last 7 days usage and open feedback; plus apps per SDK.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling": {
      "get": {
        "operationId": "v1.developer.modeling.catalog",
        "summary": "Modeling SDK catalog (public): World Labs Marble models, input kinds, the credit price table (1,250 credits = 1 USD), what the current policy enables (models, per-request cap, HQ mesh export), whether the upstream is configured, the AIDC spatial frame (metres, +Y up, ground at y = 0) and the pinned renderer versions for the viewer.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/budget": {
      "get": {
        "operationId": "v1.developer.modeling.budget",
        "summary": "World-model budget for this month (UTC): the company cap, settled credits, credits reserved by generations still running, remaining; an app ticket also sees the app's daily cap (manifest limits.worldCreditsPerDay); platform staff also see the platform-wide cap. Only callers that may spend.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/worlds": {
      "get": {
        "operationId": "v1.developer.modeling.worlds.list",
        "summary": "Worlds of the namespace, newest first: status and progress, cost (reserved / settled), asset URLs (SPZ Gaussian splats 100k / 500k / full_res, collider GLB, panorama, thumbnail on cdn.marble.worldlabs.ai), the metric frame, anchors. Worlds in the public namespace are readable with any valid credential (succeeded only, without the creator). Running worlds are synced with the upstream on read.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query_param",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "succeeded",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "ISO timestamp cursor (createdAt)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v1.developer.modeling.worlds.generate",
        "summary": "Generate a 3D world with World Labs Marble (costs credits). Admission order: worst-case estimate → policy (enabled models, per-request cap, caller maxCredits) → reuse (same model + input + seed in the namespace returns the existing world, 200, unless regenerate) → Idempotency-Key replay (200) → hourly count → platform / company monthly budget and concurrency under one transaction lock, reserving the worst case → upstream. Returns 202 with status=running (about 5 minutes; poll GET …/worlds/{id}); settles to the upstream's charged credits on completion. Requires Idempotency-Key. Apps in the public namespace may never generate. Supports dry-run (estimate, budget, the upstream payload).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "idempotency_key_required",
          "invalid_idempotency_key",
          "idempotency_conflict",
          "media_not_found",
          "modeling_unconfigured",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required for real generations (1–128 chars [A-Za-z0-9_.:-]); reuse it on retries.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "default": "marble-1.0-draft",
                    "type": "string",
                    "enum": [
                      "marble-1.0-draft",
                      "marble-1.1",
                      "marble-1.1-plus",
                      "marble-1.0"
                    ]
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "text"
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "kind",
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "image"
                          },
                          "image": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9-]{8,64}$"
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^https:\\/\\/[^\\s]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "kind",
                          "image"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "pano"
                          },
                          "image": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9-]{8,64}$"
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^https:\\/\\/[^\\s]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "kind",
                          "image"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "multi-image"
                          },
                          "images": {
                            "minItems": 2,
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "mediaId": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9-]{8,64}$"
                                },
                                "url": {
                                  "type": "string",
                                  "maxLength": 2000,
                                  "pattern": "^https:\\/\\/[^\\s]+$"
                                },
                                "azimuth": {
                                  "type": "number",
                                  "minimum": -360,
                                  "maximum": 360
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "reconstruct": {
                            "default": false,
                            "type": "boolean"
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "kind",
                          "images"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "video"
                          },
                          "video": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9-]{8,64}$"
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^https:\\/\\/[^\\s]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "kind",
                          "video"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4294967295
                  },
                  "tags": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 32,
                      "pattern": "^[^\\s,]+$"
                    }
                  },
                  "recaption": {
                    "default": true,
                    "type": "boolean"
                  },
                  "maxCredits": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000
                  },
                  "regenerate": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "input"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/worlds/{id}": {
      "get": {
        "operationId": "v1.developer.modeling.worlds.get",
        "summary": "One world: status and upstream progress (synced when running), cost, asset URLs, the AIDC spatial frame (metricScaleFactor / groundPlaneOffset), anchors, exports.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "world_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.modeling.worlds.delete",
        "summary": "Delete a world: tombstone the platform record; ?purge=1 also deletes it permanently at World Labs (only worlds generated through the platform). Running worlds cannot be deleted. Developer keys only. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "world_not_found",
          "version_conflict",
          "modeling_unconfigured",
          "model_upstream_failed"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "purge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/worlds/{id}/anchors": {
      "put": {
        "operationId": "v1.developer.modeling.worlds.anchors.set",
        "summary": "Replace the world's digital-twin anchors (PUT, naturally idempotent): positions in the AIDC spatial frame (metres), label, kind, static meta, optionally bound to a semantic-layer object of the company (the type must exist). ifRev = optimistic concurrency (409 rev_mismatch). Developer keys or developer visitors of a company app. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "world_not_found",
          "rev_mismatch",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "anchors": {
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9_-]{0,47}$"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 60
                        },
                        "kind": {
                          "default": "note",
                          "type": "string",
                          "enum": [
                            "equipment",
                            "sensor",
                            "zone",
                            "camera",
                            "note"
                          ]
                        },
                        "position": {
                          "type": "array",
                          "prefixItems": [
                            {
                              "type": "number",
                              "minimum": -10000,
                              "maximum": 10000
                            },
                            {
                              "type": "number",
                              "minimum": -10000,
                              "maximum": 10000
                            },
                            {
                              "type": "number",
                              "minimum": -10000,
                              "maximum": 10000
                            }
                          ]
                        },
                        "object": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z][A-Za-z0-9_-]*){0,4}$"
                            },
                            "pk": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            }
                          },
                          "required": [
                            "type",
                            "pk"
                          ],
                          "additionalProperties": false
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "verified": {
                          "default": false,
                          "type": "boolean"
                        },
                        "meta": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_\\u4e00-\\u9fff][A-Za-z0-9_ .\\-\\u4e00-\\u9fff%°℃()（）/·]{0,39}$"
                          },
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 200
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "position"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "ifRev": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "anchors"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/worlds/{id}/exports": {
      "post": {
        "operationId": "v1.developer.modeling.worlds.exports.create",
        "summary": "Export a world: splats-ply (Gaussian splat PLY, free, synchronous) or mesh-glb (HQ mesh, 3,500 credits, asynchronous, disabled by the default policy; an already exported mesh is returned at no cost). The same export done / running is returned as is. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "world_not_found",
          "version_conflict",
          "modeling_unconfigured",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "splats-ply"
                      },
                      "resolution": {
                        "default": "full_res",
                        "type": "string",
                        "enum": [
                          "full_res",
                          "500k",
                          "150k",
                          "100k"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "mesh-glb"
                      },
                      "variant": {
                        "default": "textured",
                        "type": "string",
                        "enum": [
                          "textured",
                          "vertex_colored"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/media": {
      "post": {
        "operationId": "v1.developer.modeling.media.prepare",
        "summary": "Prepare an input upload (image jpg/png/webp, video mp4/webm/mov/avi ≤ 100 MB / 30 s): returns the mediaId and a World Labs signed upload URL; the caller PUTs the bytes there directly (they never pass through AIDC). The mediaId is registered to the namespace and generations only accept media of their own namespace. Free, 60 per hour.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "modeling_unconfigured",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video"
                    ]
                  },
                  "fileName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[^\\\\/\\u0000-\\u001f]+$"
                  },
                  "extension": {
                    "type": "string",
                    "pattern": "^[a-z0-9]{2,5}$"
                  }
                },
                "required": [
                  "kind",
                  "fileName",
                  "extension"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/modeling/{namespace}/imports": {
      "post": {
        "operationId": "v1.developer.modeling.imports.create",
        "summary": "Register an existing Marble world (no cost, AIDC platform accounts only): worldId (fetched from World Labs) or snapshot (the World API world object as returned). Asset URLs must be on cdn.marble.worldlabs.ai. One registration per world_id per namespace (a repeat returns the existing one, 200). Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "modeling_unconfigured",
          "model_upstream_failed",
          "resource_not_found",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "worldId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9-]{8,64}$"
                  },
                  "snapshot": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "marble-1.0-draft",
                      "marble-1.1",
                      "marble-1.1-plus",
                      "marble-1.0"
                    ]
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "text",
                          "image",
                          "pano",
                          "multi-image",
                          "video"
                        ]
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  "tags": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 32,
                      "pattern": "^[^\\s,]+$"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models": {
      "get": {
        "operationId": "v1.models.catalog",
        "summary": "AIDC model catalog for the Developer model SDK: models, inputs, endpoint, whether public apps may call them and whether the upstream is configured. OpenAI-compatible base URL: /api/v1/models.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/models": {
      "get": {
        "operationId": "v1.models.openai-list",
        "summary": "OpenAI-shaped model list (what OpenAI SDKs call as client.models.list() with base URL /api/v1/models). Registered §3 OpenAI-compatible exception.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/chat/completions": {
      "post": {
        "operationId": "v1.models.chat.completions",
        "summary": "OpenAI-compatible chat.completions (text, image_url, stream, response_format) billed to the caller's company: Bearer developer key (lane developer) or app ticket (lane app, manifest model allowlist, per-IP rate limit, daily token budget, output capped at 4096 tokens). Success is OpenAI-shaped (registered §3 exception); prompts transit only.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "model_not_found",
          "rate_limited",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "messages": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "developer",
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200000
                            },
                            {
                              "minItems": 1,
                              "maxItems": 16,
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "text"
                                      },
                                      "text": {
                                        "type": "string",
                                        "maxLength": 200000
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "image_url"
                                      },
                                      "image_url": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string",
                                            "maxLength": 7000000
                                          },
                                          "detail": {
                                            "type": "string",
                                            "enum": [
                                              "auto",
                                              "low",
                                              "high"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "url"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "image_url"
                                    ]
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 64
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "top_p": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 32000
                  },
                  "max_completion_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 32000
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "enum": [
                      "minimal",
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "response_format": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "text"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "json_object"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "json_schema"
                          },
                          "json_schema": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,64}$"
                              },
                              "schema": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "strict": {
                                "type": "boolean"
                              },
                              "description": {
                                "type": "string",
                                "maxLength": 500
                              }
                            },
                            "required": [
                              "name",
                              "schema"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "json_schema"
                        ]
                      }
                    ]
                  },
                  "user": {
                    "type": "string",
                    "maxLength": 128
                  }
                },
                "required": [
                  "model",
                  "messages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/audio/transcriptions": {
      "post": {
        "operationId": "v1.models.audio.transcriptions",
        "summary": "OpenAI-compatible audio.transcriptions (multipart/form-data: file ≤ 4 MB, model, language?, prompt?). Audio transits only; usage (seconds or tokens) is recorded against the caller's company.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "model_not_found",
          "invalid_payload",
          "payload_too_large",
          "rate_limited",
          "quota_exhausted",
          "model_upstream_failed"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/realtime/transcription-sessions": {
      "post": {
        "operationId": "v1.models.realtime.transcription-sessions.create",
        "summary": "Mint a 10-minute client secret for realtime transcription (gpt-live-transcribe over WebRTC, session config pinned server-side, browser-side turn detection). Audio never passes through AIDC; sessions are capped at 5 minutes and counted per day for app tickets.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "rate_limited",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "languages": {
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "zh",
                        "en",
                        "ja",
                        "ar",
                        "bn",
                        "ko",
                        "fr",
                        "de",
                        "es",
                        "ru",
                        "vi",
                        "th",
                        "id"
                      ]
                    }
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 400,
                    "pattern": "^[^<>\\r\\n]*$"
                  },
                  "keywords": {
                    "maxItems": 30,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40,
                      "pattern": "^[^<>\\r\\n]*$"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/vision/{namespace}/cameras": {
      "get": {
        "operationId": "v1.developer.vision.cameras.list",
        "summary": "Vision SDK · the company's network cameras / NVRs (RTSP): name, title, channels, default stream, viewer cap, last connection result. App tickets only see cameras declared in the manifest (cameras); developers (key or developer visitor) also see the connection parameters — the password is never returned, only whether one is set. Cameras live in customer namespaces only (no public tier).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/vision/{namespace}/cameras/{name}": {
      "get": {
        "operationId": "v1.developer.vision.cameras.get",
        "summary": "One camera (same view as the list; connection parameters for developers only, never the password).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "camera_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "v1.developer.vision.cameras.put",
        "summary": "Register or replace a camera (PUT, naturally idempotent): vendor preset (dahua / hikvision) or a generic path template with {channel} and {stream}, public host and port, username, password (omitted = keep the stored one, empty = clear; stored only as AES-256-GCM ciphertext bound to namespace/name, never returned or logged), channels, default stream, viewer cap (default 4, protects the NVR's uplink), allowMainLive. The host must resolve to a public address. Changing the connection clears the probe result and the auth-failure cooldown. Developer keys, or developer visitors of an app that declares the camera. Supports dry-run (plan without the password).",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "vision_unconfigured",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "vendor": {
                    "default": "dahua",
                    "type": "string",
                    "enum": [
                      "dahua",
                      "hikvision",
                      "generic"
                    ]
                  },
                  "host": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253,
                    "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*|\\d{1,3}(?:\\.\\d{1,3}){3}|\\[?[0-9A-Fa-f:]+\\]?)$"
                  },
                  "port": {
                    "default": 554,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  },
                  "path": {
                    "type": "string",
                    "maxLength": 300,
                    "pattern": "^\\/[\\x21-\\x7e]*$"
                  },
                  "username": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "password": {
                    "type": "string",
                    "maxLength": 256
                  },
                  "channels": {
                    "default": [
                      {
                        "id": 1,
                        "title": ""
                      }
                    ],
                    "minItems": 1,
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 256
                        },
                        "title": {
                          "default": "",
                          "type": "string",
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "defaultStream": {
                    "default": "sub",
                    "type": "string",
                    "enum": [
                      "main",
                      "sub"
                    ]
                  },
                  "maxViewers": {
                    "default": 4,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16
                  },
                  "allowMainLive": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "title",
                  "host"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "v1.developer.vision.cameras.delete",
        "summary": "Delete a camera together with its viewing records. Developer keys only. Supports dry-run.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "camera_not_found"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/vision/{namespace}/cameras/{name}/probe": {
      "post": {
        "operationId": "v1.developer.vision.cameras.probe",
        "summary": "Probe: connect, authenticate (Digest / Basic) and read the SDP (codec, frame rate, server) without pulling video. Several channels are probed one by one to discover what the NVR has; stops at the first rejected password or unreachable host (never retries credentials — NVRs lock accounts after failures). A rejected password starts a 10-minute cooldown on the camera. Developer keys or developer visitors; counts toward the app's compute minutes.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "rate_limited",
          "quota_exhausted",
          "camera_not_found",
          "camera_auth_failed",
          "vision_unconfigured",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channels": {
                    "minItems": 1,
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 256
                    }
                  },
                  "stream": {
                    "default": "sub",
                    "type": "string",
                    "enum": [
                      "main",
                      "sub"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/vision/{namespace}/cameras/{name}/live": {
      "get": {
        "operationId": "v1.developer.vision.cameras.live",
        "summary": "Live view (streaming, application/vnd.aidc.live): pulls the channel from the NVR over RTSP/TCP only while someone watches and relays the frames untouched (H.264 / H.265, no transcoding) in the aidc-live/1 framing — hello (JSON), frame (key flag + RTP timestamp + Annex B, parameter sets before every key frame), event (ending / end / error), ping. The browser SDK decodes with WebCodecs. Starts at a key frame; lives about 280 s and announces ending first so the SDK switches to the next connection without a gap. Concurrent connections per camera ≤ maxViewers (429 camera_busy); connection time counts toward the app's compute minutes (video). Company members only (developer / member): share and public-link visitors cannot watch. stream=main requires allowMainLive.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query_param",
          "rate_limited",
          "quota_exhausted",
          "camera_not_found",
          "camera_channel_not_found",
          "camera_busy",
          "camera_unreachable",
          "camera_auth_failed",
          "camera_stream_failed",
          "camera_timeout",
          "vision_unconfigured"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 256
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sub",
                "main"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/developer/vision/{namespace}/cameras/{name}/keyframe": {
      "get": {
        "operationId": "v1.developer.vision.cameras.keyframe",
        "summary": "Snapshot: connect, wait for the next key frame and disconnect; returns that frame's raw bitstream (application/octet-stream, Annex B with parameter sets; x-aidc-codec: h264 | h265). The platform never decodes: the browser SDK decodes it with WebCodecs (vision.cameraSnapshot), the CLI converts it to JPEG with the local ffmpeg. Default stream main (high resolution). Holds a viewer slot for a few seconds; counts toward the app's compute minutes.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "invalid_path",
          "invalid_query_param",
          "rate_limited",
          "quota_exhausted",
          "camera_not_found",
          "camera_channel_not_found",
          "camera_busy",
          "camera_unreachable",
          "camera_auth_failed",
          "camera_stream_failed",
          "camera_timeout",
          "vision_unconfigured"
        ],
        "security": [],
        "parameters": [
          {
            "name": "namespace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 256
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "main",
                "sub"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/vision/detect": {
      "post": {
        "operationId": "v1.models.vision.detect",
        "summary": "Object detection (vision SDK · vision.detect): one image (data URL or https) → objects with label, confidence and a normalized box [x0,y0,x1,y1] (0–1, top-left to bottom-right). Optional labels (≤40) restrict the classes; default model gpt-6-luna. Same model channel as chat.completions (developer key or app ticket, manifest model allowlist, rate limit, daily token budget, usage billed to the caller); the image transits only.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "model_not_found",
          "rate_limited",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload",
          "payload_too_large"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "maxLength": 4508876
                  },
                  "labels": {
                    "maxItems": 40,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "maxObjects": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "reasoning": {
                    "type": "string",
                    "enum": [
                      "minimal",
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  }
                },
                "required": [
                  "image"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/jev/decisions": {
      "post": {
        "operationId": "v1.models.jev.decisions",
        "summary": "Jev (System 1) finite-choice decisions: each question lists candidate choices with criteria; returns the choice, confidence and probabilities. Metered by input tokens.",
        "x-aidc-min-role": "viewer",
        "x-aidc-error-codes": [
          "unauthorized",
          "forbidden",
          "rate_limited",
          "quota_exhausted",
          "model_upstream_failed",
          "malformed_json",
          "invalid_payload"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20000
                      },
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      }
                    ]
                  },
                  "questions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,31}$"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "instructions": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "criteria": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,40}$"
                          },
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 500
                          }
                        }
                      },
                      "required": [
                        "instructions",
                        "criteria"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "state",
                  "questions"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success envelope (docs/api-standards.md §3).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "4XX": {
            "description": "Failure envelope; error.code is one of x-aidc-error-codes or a guard code (§4/§6).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          },
          "5XX": {
            "description": "Failure envelope (internal_error or downstream dependency failure).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFailure"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "aidcSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "aidc_session",
        "description": "Opaque high-entropy first-party PersonalSession cookie. PostgreSQL stores only the SHA-256 token digest; expiry, revocation, account status, role and organizational scope are rechecked for authenticated requests."
      }
    },
    "schemas": {
      "ApiMeta": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          }
        },
        "required": [
          "generatedAt"
        ]
      },
      "ApiSuccess": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "data": {},
          "meta": {
            "$ref": "#/components/schemas/ApiMeta"
          }
        },
        "required": [
          "ok",
          "data",
          "meta"
        ]
      },
      "ApiFailure": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "email_delivery_unavailable",
                  "email_verification_required",
                  "unauthorized",
                  "invalid_session",
                  "session_secret_not_configured",
                  "forbidden",
                  "idempotency_key_required",
                  "idempotency_conflict",
                  "live_gate_required",
                  "live_operation_disabled",
                  "approval_required",
                  "approval_pending",
                  "cell_mismatch",
                  "cell_not_allowed",
                  "malformed_json",
                  "invalid_payload",
                  "invalid_query_param",
                  "invalid_path",
                  "invalid_idempotency_key",
                  "payload_too_large",
                  "rate_limited",
                  "quota_exhausted",
                  "missing_customer_cellId",
                  "customer_not_registered",
                  "customer_not_found",
                  "agent_not_found",
                  "chain_not_found",
                  "report_not_found",
                  "dataset_not_found",
                  "share_not_found",
                  "share_grant_not_found",
                  "recipient_not_found",
                  "gate_failed",
                  "server_not_found",
                  "cell_unreachable",
                  "engine_failed",
                  "server_provider_not_configured",
                  "server_operation_failed",
                  "company_lifecycle_failed",
                  "health_check_unavailable",
                  "provisioning_failed",
                  "billing_order_not_found",
                  "server_billing_report_not_ready",
                  "server_billing_rebuild_failed",
                  "aws_instance_provisioning_failed",
                  "remote_bootstrap_failed",
                  "runtime_sync_failed",
                  "model_switch_failed",
                  "drive_unreachable",
                  "drive_operation_failed",
                  "file_not_found",
                  "file_too_large",
                  "resource_not_found",
                  "file_exists",
                  "not_editable",
                  "upload_not_found",
                  "upload_state_invalid",
                  "chunk_invalid",
                  "datasource_not_found",
                  "chat_records_unavailable",
                  "runtime_logs_unavailable",
                  "usage_unavailable",
                  "conversation_not_found",
                  "conversation_active",
                  "task_not_found",
                  "chat_transport_failed",
                  "stream_resumption_unavailable",
                  "agent_runtime_error",
                  "standard_not_found",
                  "position_exists",
                  "department_unresolved",
                  "standard_exists",
                  "license_tier_downgrade",
                  "routine_not_found",
                  "deployment_not_found",
                  "member_account_not_found",
                  "agent_key_not_found",
                  "agent_not_dispatchable",
                  "flash_provider_unconfigured",
                  "flash_persona_unavailable",
                  "flash_upstream_failed",
                  "flash_local_node_exclusive",
                  "live_unconfigured",
                  "live_session_failed",
                  "local_node_context_unavailable",
                  "forbidden_path",
                  "skills_unavailable",
                  "form_not_found",
                  "submission_not_found",
                  "submission_conflict",
                  "lead_not_found",
                  "personal_account_not_found",
                  "legacy_identity_resolution_required",
                  "username_taken",
                  "email_taken",
                  "operator_not_found",
                  "self_modification_forbidden",
                  "last_admin_protected",
                  "file_share_ownership_reassignment_required",
                  "clerk_not_configured",
                  "clerk_unavailable",
                  "department_not_found",
                  "position_not_found",
                  "agent_department_mismatch",
                  "invalid_credentials",
                  "account_locked",
                  "agent_not_granted",
                  "agent_card_not_found",
                  "agent_exists",
                  "mcp_server_not_found",
                  "mcp_operation_failed",
                  "messaging_channel_not_found",
                  "messaging_operation_failed",
                  "skills_operation_failed",
                  "runtime_config_failed",
                  "runtime_policy_failed",
                  "cron_health_failed",
                  "oidc_not_configured",
                  "oidc_state_invalid",
                  "oidc_exchange_failed",
                  "identity_not_bound",
                  "identity_already_bound",
                  "identity_not_found",
                  "entity_exists",
                  "entity_not_found",
                  "release_not_found",
                  "no_table",
                  "not_materialized",
                  "table_missing",
                  "instance_not_routable",
                  "authority_insufficient",
                  "minister_outside_department",
                  "minister_scope_department_only",
                  "minister_without_department",
                  "department_required",
                  "no_targets",
                  "actor_not_found",
                  "cell_unreachable",
                  "disk_exists",
                  "disk_not_found",
                  "profile_not_found",
                  "backend_unsupported",
                  "node_exists",
                  "node_not_found",
                  "internal_error",
                  "channel_bindings_disabled",
                  "target_not_bound",
                  "delivery_not_configured",
                  "enrollment_invalid",
                  "engine_artifact_unavailable",
                  "node_not_found",
                  "node_revoked",
                  "mesh_not_enrolled",
                  "mesh_peer_not_found",
                  "mesh_denied",
                  "mesh_pair_not_found",
                  "mesh_pair_state",
                  "command_not_found",
                  "fenced",
                  "node_offline",
                  "receiver_setup_failed",
                  "weak_password",
                  "company_not_found",
                  "license_not_found",
                  "license_invalid",
                  "license_plan_missing",
                  "license_plan_expired",
                  "license_quota_exceeded",
                  "app_not_found",
                  "app_version_not_found",
                  "version_not_tested",
                  "bundle_invalid",
                  "authorization_pending",
                  "device_code_expired",
                  "access_denied",
                  "password_change_required",
                  "company_required",
                  "model_not_found",
                  "model_upstream_failed",
                  "version_conflict",
                  "stream_not_found",
                  "stream_conflict",
                  "stream_in_use",
                  "stream_event_rejected",
                  "semantic_type_not_found",
                  "action_not_found",
                  "object_not_found",
                  "object_exists",
                  "rev_mismatch",
                  "link_type_not_found",
                  "property_not_found",
                  "object_set_not_found",
                  "query_not_found",
                  "interface_not_found",
                  "value_type_not_found",
                  "shared_property_not_found",
                  "action_validation_failed",
                  "webhook_failed",
                  "unsupported_query",
                  "branch_required",
                  "branch_not_found",
                  "branch_conflict",
                  "proposal_not_found",
                  "proposal_not_mergeable",
                  "invalid_query",
                  "invalid_schema",
                  "empty_snapshot",
                  "binding_not_found",
                  "account_not_found",
                  "proposal_applied",
                  "proposal_rejected",
                  "workflow_not_found",
                  "run_not_found",
                  "capability_not_found",
                  "world_not_found",
                  "media_not_found",
                  "modeling_unconfigured",
                  "evolve_not_enabled",
                  "improvement_limit",
                  "improvement_state",
                  "camera_not_found",
                  "camera_channel_not_found",
                  "camera_unreachable",
                  "camera_auth_failed",
                  "camera_busy",
                  "camera_stream_failed",
                  "camera_timeout",
                  "vision_unconfigured",
                  "sql_query_invalid",
                  "sql_query_failed",
                  "semantic_database_unavailable",
                  "connectivity_not_found",
                  "connectivity_conflict",
                  "build_not_running",
                  "marking_not_found",
                  "marking_category_not_found",
                  "marking_name_exists"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {}
            },
            "required": [
              "code",
              "message"
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/ApiMeta"
          }
        },
        "required": [
          "ok",
          "error",
          "meta"
        ]
      }
    }
  }
}
