{
  "openapi": "3.1.0",
  "info": {
    "title": "create-bsv-app docs API",
    "version": "1.1.2",
    "description": "Machine-readable access to the create-bsv-app documentation. Everything is public and read-only.",
    "contact": {
      "name": "BSV Association",
      "url": "https://bsvassociation.org"
    },
    "license": {
      "name": "Open BSV License v6",
      "url": "https://github.com/bsv-blockchain-demos/bsv-scaffolder-intro/blob/main/LICENSE.txt"
    }
  },
  "servers": [
    {
      "url": "https://www.createbsvapp.com"
    }
  ],
  "externalDocs": {
    "url": "https://www.createbsvapp.com/docs/agents",
    "description": "Using create-bsv-app with AI agents"
  },
  "paths": {
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Index of every docs page as Markdown links",
        "responses": {
          "200": {
            "description": "llms.txt",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getLlmsFullTxt",
        "summary": "Every docs page in one Markdown file",
        "responses": {
          "200": {
            "description": "llms-full.txt",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/docs/{slug}.md": {
      "get": {
        "operationId": "getDocsPage",
        "summary": "One docs page as Markdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            },
            "description": "Page slug from /llms.txt"
          }
        ],
        "responses": {
          "200": {
            "description": "The page",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such page"
          }
        }
      }
    },
    "/search.json": {
      "get": {
        "operationId": "getSearchIndex",
        "summary": "Search index: every docs section with its heading, anchor and text",
        "responses": {
          "200": {
            "description": "Sections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Section"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP server (Streamable HTTP, stateless)",
        "description": "Tools: search_docs, get_page, list_pages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "search_docs",
                  "arguments": {
                    "query": "wallet login"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST"
          }
        }
      }
    },
    "/a2a": {
      "post": {
        "summary": "A2A agent (JSON-RPC, message/send)",
        "description": "Send a question or keywords to search, or a page slug to read that page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "message/send",
                "params": {
                  "message": {
                    "role": "user",
                    "messageId": "1",
                    "parts": [
                      {
                        "kind": "text",
                        "text": "signed requests"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Section": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "heading": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "result": {},
          "error": {
            "type": "object"
          }
        }
      }
    }
  }
}
