{
  "openapi": "3.1.0",
  "info": {
    "title": "Aitvaras service catalog API",
    "version": "0.1.0",
    "description": "Organization-scoped service catalog, packages and configuration records. Instance registration does not provision resources; wallets store public addresses only. Artifacts require independent verification."
  },
  "servers": [
    {
      "url": "https://aitvaras.ring29.com"
    }
  ],
  "paths": {
    "/api/v1/services": {
      "get": {
        "summary": "Public approved catalog; visibility=private requires services:read",
        "operationId": "get__api_v1_services",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [],
        "parameters": [
          {
            "in": "query",
            "name": "visibility",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ]
            }
          }
        ]
      },
      "post": {
        "summary": "Create private service; services:write",
        "operationId": "post__api_v1_services",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Service"
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}": {
      "get": {
        "summary": "Approved public snapshot; visibility=private requires services:read",
        "operationId": "get__api_v1_services_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "visibility",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ]
            }
          }
        ]
      },
      "put": {
        "summary": "Update private draft with current revision; services:write",
        "operationId": "put__api_v1_services_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "definition",
                  "revision"
                ],
                "additionalProperties": false,
                "properties": {
                  "definition": {
                    "$ref": "#/components/schemas/Service"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}/publication": {
      "post": {
        "summary": "Request human review or withdraw public metadata; services:write",
        "operationId": "post__api_v1_services_id_publication",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "revision",
                  "action"
                ],
                "additionalProperties": false,
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "action": {
                    "enum": [
                      "request",
                      "withdraw"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}/releases": {
      "get": {
        "summary": "List private releases; releases:read",
        "operationId": "get__api_v1_services_id_releases",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "summary": "Reserve immutable private package version; releases:write",
        "operationId": "post__api_v1_services_id_releases",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageReservation"
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/{id}/download": {
      "get": {
        "summary": "Stream own organization package; releases:read",
        "operationId": "get__api_v1_releases_id_download",
        "responses": {
          "200": {
            "description": "Private stream; compare declared SHA256 locally; signature verification remains separate",
            "headers": {
              "X-Package-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Artifact-Verification": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/intake": {
      "post": {
        "summary": "Analyze reviewed text evidence; services:write; Jev proposes only",
        "operationId": "post__api_v1_intake",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageEvidence"
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/complete": {
      "post": {
        "summary": "Record upload receipt; releases:write",
        "operationId": "post__api_v1_releases_complete",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/catalog/schema": {
      "get": {
        "summary": "Discover schemas and cross-field validation rules",
        "operationId": "get__api_v1_catalog_schema",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": []
      }
    },
    "/api/v1/agent-tokens": {
      "get": {
        "summary": "List organization keys; human org admin only",
        "operationId": "get__api_v1_agent_tokens",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ]
      },
      "post": {
        "summary": "Create API key shown once; human org admin only",
        "operationId": "post__api_v1_agent_tokens",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scopes",
                  "expiresInDays"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "services:read",
                        "services:write",
                        "releases:read",
                        "releases:write"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 4
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent-tokens/{id}": {
      "delete": {
        "summary": "Revoke organization API key; human org admin only",
        "operationId": "delete__api_v1_agent_tokens_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/services/generate": {
      "post": {
        "summary": "Generate reviewable draft from evidence; services:write. Does not save or deploy.",
        "operationId": "generate_service",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "slug",
                  "evidence"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{2,63}$"
                  },
                  "evidence": {
                    "$ref": "#/components/schemas/PackageEvidence"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service draft, incomplete release draft, Markdown guide, decisions and gaps"
          },
          "400": {
            "description": "Invalid evidence"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient scope"
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/services": {
      "get": {
        "summary": "Public approved catalog; visibility=private requires services:read",
        "operationId": "org_get__api_v1_services",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "visibility",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ]
            }
          }
        ]
      },
      "post": {
        "summary": "Create private service; services:write",
        "operationId": "org_post__api_v1_services",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Service"
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/services/{id}": {
      "get": {
        "summary": "Approved public snapshot; visibility=private requires services:read",
        "operationId": "org_get__api_v1_services_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "visibility",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ]
            }
          }
        ]
      },
      "put": {
        "summary": "Update private draft with current revision; services:write",
        "operationId": "org_put__api_v1_services_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "definition",
                  "revision"
                ],
                "additionalProperties": false,
                "properties": {
                  "definition": {
                    "$ref": "#/components/schemas/Service"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/services/{id}/publication": {
      "post": {
        "summary": "Request human review or withdraw public metadata; services:write",
        "operationId": "org_post__api_v1_services_id_publication",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "revision",
                  "action"
                ],
                "additionalProperties": false,
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "action": {
                    "enum": [
                      "request",
                      "withdraw"
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/services/{id}/releases": {
      "get": {
        "summary": "List private releases; releases:read",
        "operationId": "org_get__api_v1_services_id_releases",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "summary": "Reserve immutable private package version; releases:write",
        "operationId": "org_post__api_v1_services_id_releases",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageReservation"
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/releases/{id}/download": {
      "get": {
        "summary": "Stream own organization package; releases:read",
        "operationId": "org_get__api_v1_releases_id_download",
        "responses": {
          "200": {
            "description": "Private stream; compare declared SHA256 locally; signature verification remains separate",
            "headers": {
              "X-Package-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Artifact-Verification": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/intake": {
      "post": {
        "summary": "Analyze reviewed text evidence; services:write; Jev proposes only",
        "operationId": "org_post__api_v1_intake",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageEvidence"
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/releases/complete": {
      "post": {
        "summary": "Record upload receipt; releases:write",
        "operationId": "org_post__api_v1_releases_complete",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/agent-tokens": {
      "get": {
        "summary": "List organization keys; human org admin only",
        "operationId": "org_get__api_v1_agent_tokens",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ]
      },
      "post": {
        "summary": "Create API key shown once; human org admin only",
        "operationId": "org_post__api_v1_agent_tokens",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          },
          "201": {
            "description": "Created if this operation creates a resource"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scopes",
                  "expiresInDays"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "services:read",
                        "services:write",
                        "releases:read",
                        "releases:write"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 4
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/agent-tokens/{id}": {
      "delete": {
        "summary": "Revoke organization API key; human org admin only",
        "operationId": "org_delete__api_v1_agent_tokens_id",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient permission"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Revision or version conflict"
          }
        },
        "security": [
          {
            "GoogleSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/services/generate": {
      "post": {
        "summary": "Generate reviewable draft from evidence; services:write. Does not save or deploy.",
        "operationId": "org_generate_service",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "slug",
                  "evidence"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{2,63}$"
                  },
                  "evidence": {
                    "$ref": "#/components/schemas/PackageEvidence"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service draft, incomplete release draft, Markdown guide, decisions and gaps"
          },
          "400": {
            "description": "Invalid evidence"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Insufficient scope"
          }
        }
      },
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/orgs/{organizationId}/environments": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "List environments configuration records",
        "operationId": "list_org_environments",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "post": {
        "summary": "Create environments configuration records",
        "operationId": "create_org_environments",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Environment"
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/environments/{id}": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read environments configuration records",
        "operationId": "read_org_environments",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "put": {
        "summary": "Replace environments configuration records",
        "operationId": "replace_org_environments",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Environment"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove environments configuration records",
        "operationId": "remove_org_environments",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/instances": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "List instances configuration records",
        "operationId": "list_org_instances",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "post": {
        "summary": "Create instances configuration records",
        "operationId": "create_org_instances",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Instance"
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/instances/{id}": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read instances configuration records",
        "operationId": "read_org_instances",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "put": {
        "summary": "Replace instances configuration records",
        "operationId": "replace_org_instances",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Instance"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove instances configuration records",
        "operationId": "remove_org_instances",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/wallets": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "List wallets configuration records",
        "operationId": "list_org_wallets",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "post": {
        "summary": "Create wallets configuration records",
        "operationId": "create_org_wallets",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Wallet"
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/wallets/{id}": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read wallets configuration records",
        "operationId": "read_org_wallets",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "put": {
        "summary": "Replace wallets configuration records",
        "operationId": "replace_org_wallets",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Wallet"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove wallets configuration records",
        "operationId": "remove_org_wallets",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/apps": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "List apps configuration records",
        "operationId": "list_org_apps",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "post": {
        "summary": "Create apps configuration records",
        "operationId": "create_org_apps",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientApp"
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{organizationId}/apps/{id}": {
      "parameters": [
        {
          "name": "organizationId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read apps configuration records",
        "operationId": "read_org_apps",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      },
      "put": {
        "summary": "Replace apps configuration records",
        "operationId": "replace_org_apps",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientApp"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove apps configuration records",
        "operationId": "remove_org_apps",
        "security": [
          {
            "AgentKey": []
          },
          {
            "GoogleSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid configuration"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Wrong organization or insufficient scope"
          },
          "404": {
            "description": "Not found in organization"
          },
          "409": {
            "description": "Linked dependency or revision conflict"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AgentKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Organization-scoped expiring API key"
      },
      "GoogleSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "better-auth.session_token"
      }
    },
    "schemas": {
      "Service": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "const": "aitvaras.dev/v1alpha1"
          },
          "kind": {
            "type": "string",
            "const": "Service"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{2,63}$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "description": {
                "type": "string",
                "maxLength": 3000
              },
              "category": {
                "type": "string",
                "enum": [
                  "signer",
                  "automation",
                  "protection",
                  "institutional",
                  "custom"
                ]
              },
              "publisher": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "license": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "access": {
                    "type": "string",
                    "enum": [
                      "open-source",
                      "commercial",
                      "private"
                    ]
                  }
                },
                "required": [
                  "name",
                  "access"
                ],
                "additionalProperties": false
              },
              "documentation": {
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "slug",
              "name",
              "summary",
              "description",
              "category",
              "publisher",
              "license"
            ],
            "additionalProperties": false
          },
          "compatibility": {
            "type": "object",
            "properties": {
              "networks": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "protocols": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "targets": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "cloud": {
                      "type": "string",
                      "enum": [
                        "AWS",
                        "Azure",
                        "GCP",
                        "On-premises"
                      ]
                    },
                    "runtime": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{2,63}$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "proposed",
                        "tested"
                      ]
                    }
                  },
                  "required": [
                    "cloud",
                    "runtime",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "networks",
              "protocols",
              "targets"
            ],
            "additionalProperties": false
          },
          "interfaces": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{2,63}$"
                },
                "transport": {
                  "type": "string",
                  "enum": [
                    "http",
                    "grpc",
                    "nats",
                    "vsock",
                    "custom"
                  ]
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "name",
                "transport",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "dependencies": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{2,63}$"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "nats",
                    "postgresql",
                    "rpc",
                    "signer",
                    "policy",
                    "custom"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "name",
                "kind",
                "required",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "configuration": {
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[A-Z][A-Z0-9_]{1,79}$"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "string",
                    "integer",
                    "boolean",
                    "secret-reference"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "key",
                "type",
                "required",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "readiness": {
            "type": "string",
            "enum": [
              "planned",
              "sample",
              "private-integration",
              "packaging-ready"
            ]
          },
          "extensions": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9.-]+\\/[a-zA-Z][a-zA-Z0-9_.-]+$"
            },
            "additionalProperties": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "required": [
          "apiVersion",
          "kind",
          "metadata",
          "compatibility",
          "interfaces",
          "dependencies",
          "configuration",
          "readiness"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "https://aitvaras.ring29.com/schemas/Service.schema.json"
      },
      "ServiceRelease": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "const": "aitvaras.dev/v1alpha1"
          },
          "kind": {
            "type": "string",
            "const": "ServiceRelease"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{2,63}$"
              },
              "version": {
                "type": "string",
                "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9.-]+)?$"
              },
              "supplier": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "product": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            },
            "required": [
              "name",
              "version",
              "supplier",
              "product"
            ],
            "additionalProperties": false
          },
          "executor": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{2,63}$"
              },
              "contractVersion": {
                "type": "string",
                "const": "1"
              },
              "architecture": {
                "type": "string",
                "enum": [
                  "amd64",
                  "arm64"
                ]
              }
            },
            "required": [
              "type",
              "contractVersion",
              "architecture"
            ],
            "additionalProperties": false
          },
          "artifact": {
            "type": "object",
            "properties": {
              "format": {
                "type": "string",
                "enum": [
                  "nitro-eif",
                  "oci-archive"
                ]
              },
              "path": {
                "type": "string",
                "maxLength": 240,
                "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "sizeBytes": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 4294967296
              },
              "sourceRevision": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "format",
              "path",
              "sha256",
              "sizeBytes",
              "sourceRevision"
            ],
            "additionalProperties": false
          },
          "files": {
            "minItems": 1,
            "maxItems": 256,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 240,
                  "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4294967296
                }
              },
              "required": [
                "path",
                "sha256",
                "sizeBytes"
              ],
              "additionalProperties": false
            }
          },
          "attestation": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "expectedSigned": {
                    "type": "boolean"
                  },
                  "pcrs": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "PCR0",
                        "PCR1",
                        "PCR2",
                        "PCR3",
                        "PCR4",
                        "PCR8"
                      ]
                    },
                    "additionalProperties": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{96}$"
                    }
                  },
                  "debugAllowed": {
                    "type": "boolean",
                    "const": false
                  },
                  "profile": {
                    "type": "string",
                    "const": "aws-nitro"
                  }
                },
                "required": [
                  "expectedSigned",
                  "pcrs",
                  "debugAllowed",
                  "profile"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": "string",
                    "enum": [
                      "intel-tdx",
                      "amd-sev-snp",
                      "custom"
                    ]
                  },
                  "debugAllowed": {
                    "type": "boolean",
                    "const": false
                  },
                  "referenceValuesPath": {
                    "type": "string",
                    "maxLength": 240,
                    "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                  },
                  "policyPath": {
                    "type": "string",
                    "maxLength": 240,
                    "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                  },
                  "verifier": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "profile",
                  "debugAllowed",
                  "referenceValuesPath",
                  "policyPath",
                  "verifier"
                ],
                "additionalProperties": false
              }
            ]
          },
          "signatures": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "purpose": {
                  "type": "string",
                  "enum": [
                    "release-manifest",
                    "eif"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "not-provided",
                    "provided-unverified"
                  ]
                },
                "path": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 240,
                      "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "certificatePath": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 240,
                      "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signerFingerprint": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "purpose",
                "status",
                "path",
                "certificatePath",
                "signerFingerprint"
              ],
              "additionalProperties": false
            }
          },
          "compatibility": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "unresolved",
                  "declared-tested"
                ]
              },
              "evidencePaths": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 240,
                  "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                }
              },
              "versions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{2,63}$"
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 100
                }
              }
            },
            "required": [
              "status",
              "evidencePaths",
              "versions"
            ],
            "additionalProperties": false
          },
          "requirements": {
            "type": "object",
            "properties": {
              "cpu": {
                "type": "integer",
                "minimum": 1,
                "maximum": 64
              },
              "memoryMiB": {
                "type": "integer",
                "minimum": 512,
                "maximum": 524288
              },
              "vsockPorts": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 65535
                }
              },
              "dependencies": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "nats",
                    "postgres",
                    "kms",
                    "secrets-manager",
                    "s3",
                    "oidc"
                  ]
                }
              },
              "customerInputs": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Z][A-Z0-9_]{1,79}$"
                }
              }
            },
            "required": [
              "cpu",
              "memoryMiB",
              "vsockPorts",
              "dependencies",
              "customerInputs"
            ],
            "additionalProperties": false
          },
          "extensions": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9.-]+\\/[a-zA-Z][a-zA-Z0-9_.-]+$"
            },
            "additionalProperties": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "required": [
          "apiVersion",
          "kind",
          "metadata",
          "executor",
          "artifact",
          "files",
          "attestation",
          "signatures",
          "compatibility",
          "requirements"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "https://aitvaras.ring29.com/schemas/ServiceRelease.schema.json"
      },
      "PackageReservation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "manifest": {
            "type": "object",
            "properties": {
              "apiVersion": {
                "type": "string",
                "const": "aitvaras.dev/v1alpha1"
              },
              "kind": {
                "type": "string",
                "const": "ServiceRelease"
              },
              "metadata": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{2,63}$"
                  },
                  "version": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9.-]+)?$"
                  },
                  "supplier": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "product": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "name",
                  "version",
                  "supplier",
                  "product"
                ],
                "additionalProperties": false
              },
              "executor": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{2,63}$"
                  },
                  "contractVersion": {
                    "type": "string",
                    "const": "1"
                  },
                  "architecture": {
                    "type": "string",
                    "enum": [
                      "amd64",
                      "arm64"
                    ]
                  }
                },
                "required": [
                  "type",
                  "contractVersion",
                  "architecture"
                ],
                "additionalProperties": false
              },
              "artifact": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "nitro-eif",
                      "oci-archive"
                    ]
                  },
                  "path": {
                    "type": "string",
                    "maxLength": 240,
                    "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "sizeBytes": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 4294967296
                  },
                  "sourceRevision": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "format",
                  "path",
                  "sha256",
                  "sizeBytes",
                  "sourceRevision"
                ],
                "additionalProperties": false
              },
              "files": {
                "minItems": 1,
                "maxItems": 256,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "maxLength": 240,
                      "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "sizeBytes": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4294967296
                    }
                  },
                  "required": [
                    "path",
                    "sha256",
                    "sizeBytes"
                  ],
                  "additionalProperties": false
                }
              },
              "attestation": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "expectedSigned": {
                        "type": "boolean"
                      },
                      "pcrs": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "enum": [
                            "PCR0",
                            "PCR1",
                            "PCR2",
                            "PCR3",
                            "PCR4",
                            "PCR8"
                          ]
                        },
                        "additionalProperties": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{96}$"
                        }
                      },
                      "debugAllowed": {
                        "type": "boolean",
                        "const": false
                      },
                      "profile": {
                        "type": "string",
                        "const": "aws-nitro"
                      }
                    },
                    "required": [
                      "expectedSigned",
                      "pcrs",
                      "debugAllowed",
                      "profile"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "profile": {
                        "type": "string",
                        "enum": [
                          "intel-tdx",
                          "amd-sev-snp",
                          "custom"
                        ]
                      },
                      "debugAllowed": {
                        "type": "boolean",
                        "const": false
                      },
                      "referenceValuesPath": {
                        "type": "string",
                        "maxLength": 240,
                        "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                      },
                      "policyPath": {
                        "type": "string",
                        "maxLength": 240,
                        "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                      },
                      "verifier": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "profile",
                      "debugAllowed",
                      "referenceValuesPath",
                      "policyPath",
                      "verifier"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "signatures": {
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "purpose": {
                      "type": "string",
                      "enum": [
                        "release-manifest",
                        "eif"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "not-provided",
                        "provided-unverified"
                      ]
                    },
                    "path": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 240,
                          "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "certificatePath": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 240,
                          "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "signerFingerprint": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 200
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "purpose",
                    "status",
                    "path",
                    "certificatePath",
                    "signerFingerprint"
                  ],
                  "additionalProperties": false
                }
              },
              "compatibility": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "unresolved",
                      "declared-tested"
                    ]
                  },
                  "evidencePaths": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 240,
                      "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                    }
                  },
                  "versions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{2,63}$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 100
                    }
                  }
                },
                "required": [
                  "status",
                  "evidencePaths",
                  "versions"
                ],
                "additionalProperties": false
              },
              "requirements": {
                "type": "object",
                "properties": {
                  "cpu": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  },
                  "memoryMiB": {
                    "type": "integer",
                    "minimum": 512,
                    "maximum": 524288
                  },
                  "vsockPorts": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 65535
                    }
                  },
                  "dependencies": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "nats",
                        "postgres",
                        "kms",
                        "secrets-manager",
                        "s3",
                        "oidc"
                      ]
                    }
                  },
                  "customerInputs": {
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Z][A-Z0-9_]{1,79}$"
                    }
                  }
                },
                "required": [
                  "cpu",
                  "memoryMiB",
                  "vsockPorts",
                  "dependencies",
                  "customerInputs"
                ],
                "additionalProperties": false
              },
              "extensions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9.-]+\\/[a-zA-Z][a-zA-Z0-9_.-]+$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            },
            "required": [
              "apiVersion",
              "kind",
              "metadata",
              "executor",
              "artifact",
              "files",
              "attestation",
              "signatures",
              "compatibility",
              "requirements"
            ],
            "additionalProperties": false
          },
          "packageSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sizeBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1073741824
          },
          "filename": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,150}\\.(?:tar\\.gz|eif|tar)$"
          }
        },
        "required": [
          "manifest",
          "packageSha256",
          "sizeBytes",
          "filename"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "https://aitvaras.ring29.com/schemas/PackageReservation.schema.json"
      },
      "PackageEvidence": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "const": "aitvaras.dev/v1alpha1"
          },
          "kind": {
            "type": "string",
            "const": "PackageEvidence"
          },
          "inventory": {
            "minItems": 1,
            "maxItems": 256,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 240,
                  "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4294967296
                }
              },
              "required": [
                "path",
                "sha256",
                "sizeBytes"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 240,
                  "pattern": "^[A-Za-z0-9_.][A-Za-z0-9_./-]*$"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "text": {
                  "type": "string",
                  "maxLength": 8192
                },
                "truncated": {
                  "type": "boolean"
                }
              },
              "required": [
                "path",
                "sha256",
                "text",
                "truncated"
              ],
              "additionalProperties": false
            }
          },
          "warnings": {
            "maxItems": 256,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 240
                },
                "reason": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "path",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "verification": {
            "type": "string",
            "const": "inventory-only"
          },
          "deploymentEnabled": {
            "type": "boolean",
            "const": false
          }
        },
        "required": [
          "apiVersion",
          "kind",
          "inventory",
          "sources",
          "warnings",
          "verification",
          "deploymentEnabled"
        ],
        "additionalProperties": false,
        "$id": "https://aitvaras.ring29.com/schemas/PackageEvidence.schema.json"
      },
      "Environment": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{2,47}$"
          },
          "accountId": {
            "type": "string",
            "pattern": "^\\d{12}$"
          },
          "region": {
            "type": "string",
            "pattern": "^[a-z]{2}(?:-[a-z]+)+-\\d$"
          },
          "roleArn": {
            "type": "string",
            "pattern": "^arn:aws:iam::\\d{12}:role\\/[A-Za-z0-9+=,.@_/-]+$"
          },
          "subnetId": {
            "type": "string",
            "pattern": "^subnet-[a-f0-9]{8,17}$"
          }
        },
        "required": [
          "name",
          "accountId",
          "region",
          "roleArn",
          "subnetId"
        ],
        "additionalProperties": false,
        "$id": "https://aitvaras.ring29.com/schemas/Environment.schema.json"
      },
      "Instance": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "serviceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "environmentId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "externalId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
          },
          "endpoint": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "name",
          "serviceId",
          "environmentId"
        ],
        "additionalProperties": false,
        "$id": "https://aitvaras.ring29.com/schemas/Instance.schema.json"
      },
      "Wallet": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "instanceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "chainId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          }
        },
        "required": [
          "name",
          "instanceId",
          "chainId",
          "address"
        ],
        "additionalProperties": false,
        "$id": "https://aitvaras.ring29.com/schemas/Wallet.schema.json"
      },
      "ClientApp": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "kind": {
            "type": "string",
            "enum": [
              "app",
              "widget"
            ]
          },
          "url": {
            "type": "string",
            "maxLength": 500
          },
          "serviceIds": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "name",
          "kind",
          "url",
          "serviceIds"
        ],
        "additionalProperties": false,
        "$id": "https://aitvaras.ring29.com/schemas/ClientApp.schema.json"
      }
    }
  }
}
