{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://resoluteaim.com/api/submission-schema.json",
 "title": "Resolute AIM tool submission",
 "description": "Vendor submission for an independent AI-friendliness review. Category ids must come from labels.category in https://resoluteaim.com/api/tools.json.",
 "type": "object",
 "required": ["tool", "vendor_contact", "credentials", "test_cases"],
 "properties": {
  "tool": {
   "type": "object",
   "required": ["name", "vendor", "category", "website"],
   "properties": {
    "name": {"type": "string", "maxLength": 80},
    "vendor": {"type": "string", "maxLength": 80},
    "category": {"type": "string", "description": "A key from labels.category in /api/tools.json"},
    "website": {"type": "string", "format": "uri"},
    "docs_url": {"type": "string", "format": "uri"},
    "openapi_url": {"type": "string", "format": "uri"},
    "mcp_endpoint": {"type": "string", "description": "MCP server URL or install reference, if published"}
   }
  },
  "vendor_contact": {
   "type": "object",
   "required": ["name", "email"],
   "properties": {
    "name": {"type": "string"},
    "email": {"type": "string", "format": "email"},
    "role": {"type": "string"}
   }
  },
  "credentials": {
   "type": "object",
   "required": ["environment", "auth_type", "scopes", "revocation_contact"],
   "properties": {
    "environment": {
     "enum": ["sandbox", "demo-tenant", "trial"],
     "description": "Never production. Reviews only run against non-customer data."
    },
    "auth_type": {
     "enum": ["api-key", "oauth2-client-credentials", "oauth2-authorization-code", "service-account", "mcp"]
    },
    "scopes": {
     "type": "array",
     "items": {"type": "string"},
     "minItems": 1,
     "description": "Least-privilege scopes granted to the review token"
    },
    "token_delivery": {
     "type": "string",
     "description": "How you will hand us the secret (never include it in the submission itself)"
    },
    "expires": {
     "type": "string",
     "format": "date",
     "description": "Token validity end date; 30 days requested"
    },
    "revocation_contact": {"type": "string", "format": "email"}
   }
  },
  "test_cases": {
   "type": "array",
   "minItems": 3,
   "items": {
    "type": "object",
    "required": ["id", "title", "goal", "steps", "expected_result"],
    "properties": {
     "id": {"type": "string", "pattern": "^tc-[0-9]{2,}$"},
     "title": {"type": "string", "maxLength": 120},
     "goal": {"type": "string"},
     "steps": {"type": "array", "items": {"type": "string"}, "minItems": 1},
     "expected_result": {"type": "string"},
     "agent_accessible": {
      "type": "boolean",
      "description": "True if an API- or MCP-driven agent can complete this unaided"
     },
     "cleanup": {"type": "string"}
    }
   }
  },
  "notes": {"type": "string", "maxLength": 2000}
 }
}
