{
  "openapi": "3.1.0",
  "info": {
    "title": "MasteryGit door",
    "version": "0.1.0",
    "description": "Short-lived read grants for an owner and a repo. Cloudflare Access is required. No charge is applied."
  },
  "servers": [
    {
      "url": "https://git.ergentics.com"
    },
    {
      "url": "https://artifacts-worker.ergentics.workers.dev"
    }
  ],
  "paths": {
    "/domain": {
      "get": {
        "summary": "Mint a short-lived read grant",
        "parameters": [
          {
            "name": "owner",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grant JSON. The read token is in X-Artifacts-Read-Token."
          }
        }
      }
    },
    "/api/read": {
      "post": {
        "summary": "Mint the same read grant",
        "responses": {
          "200": {
            "description": "Grant JSON. The read token is in X-Artifacts-Read-Token."
          }
        }
      }
    },
    "/dataset": {
      "get": {
        "summary": "Read a file and revoke the token before the response",
        "parameters": [
          {
            "name": "repo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File text, capped at 32000 characters."
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "Stateless MCP endpoint",
        "responses": {
          "200": {
            "description": "JSON-RPC. The tool read_repo returns file text."
          }
        }
      }
    }
  }
}
