{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Agents Nexus REST API",
    "version": "0.3.1",
    "description": "Contract for conventional REST and document endpoints. The separate tRPC surface is documented at https://www.aiagents.nexus/api-reference/trpc.md.",
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    }
  },
  "servers": [
    {
      "url": "https://api.aiagents.nexus",
      "description": "Canonical production API"
    }
  ],
  "externalDocs": {
    "description": "tRPC procedure reference",
    "url": "https://www.aiagents.nexus/api-reference/trpc.md"
  },
  "tags": [
    {
      "name": "Operations",
      "description": "Service status and installation"
    },
    {
      "name": "Discovery",
      "description": "Sitemaps and API descriptions"
    },
    {
      "name": "Blog",
      "description": "Public blog feeds and administrative media upload"
    },
    {
      "name": "Showcase",
      "description": "Public showcase media upload"
    }
  ],
  "paths": {
    "/api/marketplace/skills": {
      "get": {
        "operationId": "listSkills",
        "summary": "Approved releases, newest submission first; 50 per page",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/skills/{name}": {
      "get": {
        "operationId": "latestSkill",
        "summary": "Most recently submitted approved release; pin a version for reproducibility",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryVersion"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/skills/{name}/{version}": {
      "get": {
        "operationId": "getSkillRelease",
        "summary": "Immutable approved release metadata",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryVersion"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/skills/{name}/{version}/package": {
      "get": {
        "operationId": "downloadSkill",
        "summary": "Download approved WASM (approval checked on every request)",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw WASM binary; at most 16 MiB; verify size and SHA-256 from the release metadata",
            "content": {
              "application/wasm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/skills/{name}/{version}/manifest": {
      "get": {
        "operationId": "downloadManifest",
        "summary": "Manifest of an approved release",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillManifest"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/mine": {
      "get": {
        "operationId": "mySkillReleases",
        "summary": "Signed-in developer’s releases, including pending and rejected",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/review": {
      "get": {
        "operationId": "reviewQueue",
        "summary": "Administrator release review list",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/review/{name}/{version}/package": {
      "get": {
        "operationId": "inspectSkill",
        "summary": "Administrator inspection download",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
            }
          }
        ],
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Raw WASM binary; at most 16 MiB; verify size and SHA-256 from the release metadata",
            "content": {
              "application/wasm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/publish": {
      "post": {
        "operationId": "submitSkill",
        "summary": "Submit an immutable free WASIp1 release for manual review; does not publish immediately",
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "manifest",
                  "wasm"
                ],
                "properties": {
                  "manifest": {
                    "type": "string",
                    "maxLength": 25000,
                    "description": "JSON-encoded SkillManifest; maximum 25 KB UTF-8",
                    "contentMediaType": "application/json",
                    "contentSchema": {
                      "$ref": "#/components/schemas/SkillManifest"
                    }
                  },
                  "wasm": {
                    "type": "string",
                    "format": "binary",
                    "description": "WASIp1 binary, maximum 16 MiB"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrySubmission"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/review/{id}": {
      "post": {
        "operationId": "reviewSkill",
        "summary": "Administrator: pending → approved/rejected; approved → revoked. Notes required.",
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistryReview"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields, JSON, or package; correct the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired Clerk token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Owner or administrator permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved resource exists at this URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Immutable version conflict or invalid review transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Submission quota or request concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database or package storage unavailable; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/blog/{slug}.md": {
      "get": {
        "operationId": "getBlogMarkdown",
        "summary": "Full published blog Markdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full published post",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Post is not published or does not exist"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/docs-markdown/blog/{slug}.md": {
      "get": {
        "operationId": "getBlogDocument",
        "summary": "Published blog Markdown alias",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full published post",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No published post"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/docs-markdown/showcase/{slug}.md": {
      "get": {
        "operationId": "getShowcaseDocument",
        "summary": "Full approved showcase Markdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full approved project",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No approved project"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/docs-markdown/site/marketplace.md": {
      "get": {
        "operationId": "getMarketplaceDocument",
        "summary": "Live approved catalog; 50 per page",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Live approved releases with links to version documents",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid offset"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/docs-markdown/marketplace/{name}/{version}.md": {
      "get": {
        "operationId": "getSkillDocument",
        "summary": "Complete immutable approved release documentation",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete version-specific skill document",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid identifier"
          },
          "404": {
            "description": "No approved version"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Operations"
        ],
        "operationId": "getHealth",
        "summary": "Check service health",
        "responses": {
          "200": {
            "description": "Service is accepting requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/install.sh": {
      "get": {
        "tags": [
          "Operations"
        ],
        "operationId": "getInstallScript",
        "summary": "Download the portable naos installer",
        "responses": {
          "200": {
            "description": "Shell installer source.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/sitemap.xml": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getSitemap",
        "summary": "Get the canonical public-site sitemap",
        "responses": {
          "200": {
            "description": "Complete public-site XML sitemap.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getOpenApiDocument",
        "summary": "Get this OpenAPI contract",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/blog/feed.xml": {
      "get": {
        "tags": [
          "Blog"
        ],
        "operationId": "getBlogFeed",
        "summary": "Get the public Atom blog feed",
        "responses": {
          "200": {
            "description": "Atom 1.0 feed of published posts.",
            "content": {
              "application/atom+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/blog/sitemap.xml": {
      "get": {
        "deprecated": true,
        "tags": [
          "Blog"
        ],
        "operationId": "getLegacyBlogSitemap",
        "summary": "Get the legacy blog sitemap",
        "description": "Prefer /api/sitemap.xml for complete coverage.",
        "responses": {
          "308": {
            "description": "Permanent redirect to /api/sitemap.xml",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/blog/upload-image": {
      "post": {
        "tags": [
          "Blog"
        ],
        "operationId": "uploadBlogImage",
        "summary": "Upload an administrative blog image",
        "security": [
          {
            "ClerkBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPEG, PNG, WebP, GIF, or AVIF up to 100 MB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/UploadSuccess"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "description": "Administrator session required."
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/showcase/upload-image": {
      "post": {
        "tags": [
          "Showcase"
        ],
        "operationId": "uploadShowcaseImage",
        "summary": "Upload a public showcase image",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPEG, PNG, WebP, GIF, or AVIF up to 10 MB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/UploadSuccess"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ClerkBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Clerk session JWT",
        "description": "Clerk bearer token; administrator role is required where stated."
      }
    },
    "schemas": {
      "SkillManifest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1
          },
          "name": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "description": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500
          },
          "readme": {
            "type": "string",
            "minLength": 20,
            "maxLength": 20000
          },
          "inputs": {
            "type": "string",
            "minLength": 10,
            "maxLength": 2000
          },
          "outputs": {
            "type": "string",
            "minLength": 10,
            "maxLength": 2000
          },
          "examples": {
            "minItems": 1,
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "input": {
                  "type": "string",
                  "maxLength": 2000
                },
                "output": {
                  "type": "string",
                  "maxLength": 2000
                }
              },
              "required": [
                "input",
                "output"
              ],
              "additionalProperties": false
            }
          },
          "license": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "category": {
            "type": "string",
            "enum": [
              "Validators",
              "Parsers",
              "Transformers",
              "Calculators",
              "Data",
              "Other"
            ]
          },
          "runtime": {
            "type": "string",
            "const": "wasip1-command"
          },
          "entrypoint": {
            "type": "string",
            "const": "_start"
          },
          "pricing": {
            "type": "string",
            "const": "free"
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "version",
          "description",
          "readme",
          "inputs",
          "outputs",
          "examples",
          "license",
          "category",
          "runtime",
          "entrypoint",
          "pricing"
        ],
        "additionalProperties": false
      },
      "RegistryVersion": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "manifest": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "number",
                "const": 1
              },
              "name": {
                "type": "string",
                "maxLength": 64,
                "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
              },
              "version": {
                "type": "string",
                "maxLength": 32,
                "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
              },
              "description": {
                "type": "string",
                "minLength": 10,
                "maxLength": 500
              },
              "readme": {
                "type": "string",
                "minLength": 20,
                "maxLength": 20000
              },
              "inputs": {
                "type": "string",
                "minLength": 10,
                "maxLength": 2000
              },
              "outputs": {
                "type": "string",
                "minLength": 10,
                "maxLength": 2000
              },
              "examples": {
                "minItems": 1,
                "maxItems": 3,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "output": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "required": [
                    "input",
                    "output"
                  ],
                  "additionalProperties": false
                }
              },
              "license": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "category": {
                "type": "string",
                "enum": [
                  "Validators",
                  "Parsers",
                  "Transformers",
                  "Calculators",
                  "Data",
                  "Other"
                ]
              },
              "runtime": {
                "type": "string",
                "const": "wasip1-command"
              },
              "entrypoint": {
                "type": "string",
                "const": "_start"
              },
              "pricing": {
                "type": "string",
                "const": "free"
              }
            },
            "required": [
              "schemaVersion",
              "name",
              "version",
              "description",
              "readme",
              "inputs",
              "outputs",
              "examples",
              "license",
              "category",
              "runtime",
              "entrypoint",
              "pricing"
            ],
            "additionalProperties": false
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "size": {
            "type": "integer",
            "minimum": 8,
            "maximum": 16777216
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "revoked"
            ]
          },
          "ownerId": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "publisher": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "reviewReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "version",
          "manifest",
          "sha256",
          "size",
          "status",
          "ownerId",
          "publisher",
          "createdAt",
          "reviewReason"
        ],
        "additionalProperties": false
      },
      "RegistryList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "name": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "version": {
                  "type": "string",
                  "maxLength": 32,
                  "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
                },
                "manifest": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "number",
                      "const": 1
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 64,
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "version": {
                      "type": "string",
                      "maxLength": 32,
                      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 10,
                      "maxLength": 500
                    },
                    "readme": {
                      "type": "string",
                      "minLength": 20,
                      "maxLength": 20000
                    },
                    "inputs": {
                      "type": "string",
                      "minLength": 10,
                      "maxLength": 2000
                    },
                    "outputs": {
                      "type": "string",
                      "minLength": 10,
                      "maxLength": 2000
                    },
                    "examples": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "input": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "output": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "input",
                          "output"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "license": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "Validators",
                        "Parsers",
                        "Transformers",
                        "Calculators",
                        "Data",
                        "Other"
                      ]
                    },
                    "runtime": {
                      "type": "string",
                      "const": "wasip1-command"
                    },
                    "entrypoint": {
                      "type": "string",
                      "const": "_start"
                    },
                    "pricing": {
                      "type": "string",
                      "const": "free"
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "name",
                    "version",
                    "description",
                    "readme",
                    "inputs",
                    "outputs",
                    "examples",
                    "license",
                    "category",
                    "runtime",
                    "entrypoint",
                    "pricing"
                  ],
                  "additionalProperties": false
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "size": {
                  "type": "integer",
                  "minimum": 8,
                  "maximum": 16777216
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "approved",
                    "rejected",
                    "revoked"
                  ]
                },
                "ownerId": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "publisher": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "reviewReason": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "version",
                "manifest",
                "sha256",
                "size",
                "status",
                "ownerId",
                "publisher",
                "createdAt",
                "reviewReason"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "RegistrySubmission": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "const": "pending"
          },
          "name": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "id",
          "status",
          "name",
          "version",
          "sha256"
        ],
        "additionalProperties": false
      },
      "RegistryReview": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "approved",
              "rejected",
              "revoked"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 2000
          }
        },
        "required": [
          "action",
          "reason"
        ],
        "additionalProperties": false
      },
      "Success": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "HealthResponse": {
        "type": "object",
        "required": [
          "status",
          "service",
          "timestamp"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          },
          "service": {
            "type": "string",
            "const": "nexus-site"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UploadResponse": {
        "type": "object",
        "required": [
          "url",
          "key"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "key": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "UploadSuccess": {
        "description": "Image stored successfully.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UploadResponse"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Missing image or unsupported format.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ServerError": {
        "description": "Server could not complete the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  },
  "x-nexus-generated": {
    "at": "2026-09-08T01:06:59.917Z",
    "source": "server/_core/index.ts",
    "generation": "Schema extraction; test results are published separately by CI"
  }
}
