{
  "openapi": "3.1.0",
  "info": {
    "title": "Ultron API",
    "version": "1.0.0",
    "description": "Public programmatic surface for Ultron: competitor monitoring, brand tracking, milestones and skill discovery. Authenticated endpoints (chat, user state, share-link creation) are advertised separately via /.well-known/oauth-protected-resource.",
    "contact": {
      "name": "Ultron",
      "url": "https://app.51ultron.com/contact",
      "email": "hello@nexitynetwork.org"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://app.51ultron.com/docs/legal"
    }
  },
  "servers": [
    {
      "url": "https://app.51ultron.com"
    }
  ],
  "externalDocs": {
    "description": "Docs",
    "url": "https://app.51ultron.com/docs"
  },
  "tags": [
    {
      "name": "watcher",
      "description": "Competitor monitoring."
    },
    {
      "name": "milestones",
      "description": "Company state + journey tracking."
    },
    {
      "name": "brands",
      "description": "AEO brand tracking."
    },
    {
      "name": "skills",
      "description": "Skill discovery and metadata."
    }
  ],
  "paths": {
    "/api/watcher/threats": {
      "get": {
        "tags": [
          "watcher"
        ],
        "summary": "Ranked competitor threats for the demo workspace.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Threat list."
          }
        }
      }
    },
    "/api/watcher/changes": {
      "get": {
        "tags": [
          "watcher"
        ],
        "summary": "Recent changes detected across tracked competitors.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Change feed."
          }
        }
      }
    },
    "/api/brands": {
      "get": {
        "tags": [
          "brands"
        ],
        "summary": "Tracked brand list for the demo workspace.",
        "responses": {
          "200": {
            "description": "Brand records."
          }
        }
      }
    },
    "/api/milestones/users/{user_id}": {
      "get": {
        "tags": [
          "milestones"
        ],
        "summary": "Milestones earned by a user.",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Milestone records."
          }
        }
      }
    },
    "/api/milestones/users/{user_id}/stage": {
      "get": {
        "tags": [
          "milestones"
        ],
        "summary": "Stage progression view derived from milestones.",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "6-stage journey view."
          }
        }
      }
    },
    "/.well-known/agent-skills/index.json": {
      "get": {
        "tags": [
          "skills"
        ],
        "summary": "Agent Skills Discovery RFC v0.2.0 index.",
        "responses": {
          "200": {
            "description": "Skill catalogue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSkillsIndex"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase-issued bearer token. Obtain via the OAuth flow advertised at /.well-known/oauth-authorization-server."
      }
    },
    "schemas": {
      "AgentSkillsIndex": {
        "type": "object",
        "required": [
          "version",
          "site",
          "skills"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "site": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentSkill"
            }
          }
        }
      },
      "AgentSkill": {
        "type": "object",
        "required": [
          "name",
          "type",
          "description",
          "url",
          "sha256"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill",
              "tool"
            ]
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "sha256": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cost_class": {
            "type": "string"
          },
          "background": {
            "type": "boolean"
          }
        }
      }
    }
  }
}