{
  "openapi": "3.1.0",
  "info": {
    "title": "Adchitects Public Discovery API",
    "version": "1.0.0",
    "description": "Public machine-readable discovery endpoints for Adchitects."
  },
  "servers": [
    {
      "url": "https://adchitects.co"
    }
  ],
  "paths": {
    "/api/health.json": {
      "get": {
        "summary": "Read public discovery health",
        "operationId": "getDiscoveryHealth",
        "responses": {
          "200": {
            "description": "Discovery endpoint health status",
            "content": {
              "application/health+json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatus"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/api-catalog": {
      "get": {
        "summary": "Read API catalog",
        "operationId": "getApiCatalog",
        "responses": {
          "200": {
            "description": "RFC 9727 API catalog as an RFC 9264 JSON linkset",
            "content": {
              "application/linkset+json": {
                "schema": {
                  "$ref": "#/components/schemas/Linkset"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/agent-skills/index.json": {
      "get": {
        "summary": "Read agent skills index",
        "operationId": "getAgentSkillsIndex",
        "responses": {
          "200": {
            "description": "Agent Skills Discovery v0.2 index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSkillsIndex"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "Read LLM-friendly site overview",
        "operationId": "getLlmsTxt",
        "responses": {
          "200": {
            "description": "Markdown overview for language models",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthStatus": {
        "type": "object",
        "required": ["status", "serviceId"],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["pass", "warn", "fail"]
          },
          "serviceId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": ["status"],
              "properties": {
                "status": {
                  "type": "string",
                  "enum": ["pass", "warn", "fail"]
                },
                "componentId": {
                  "type": "string"
                },
                "componentType": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Linkset": {
        "type": "object",
        "required": ["linkset"],
        "properties": {
          "linkset": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["anchor"],
              "properties": {
                "anchor": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "AgentSkillsIndex": {
        "type": "object",
        "required": ["$schema", "skills"],
        "properties": {
          "$schema": {
            "type": "string",
            "format": "uri"
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name", "type", "description", "url", "digest"],
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": ["skill-md", "archive"]
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "digest": {
                  "type": "string",
                  "pattern": "^sha256:[a-f0-9]{64}$"
                }
              }
            }
          }
        }
      }
    }
  }
}
