{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://botshelfvampire.com/schemas/capability-manifest-v0.1.json",
  "title": "BSV Capability Manifest",
  "type": "object",
  "required": [
    "schemaVersion",
    "capabilityId",
    "title",
    "job",
    "domains",
    "inputs",
    "outputs",
    "runtime",
    "verification",
    "sideEffects",
    "approvalBoundary",
    "license",
    "monetization"
  ],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": {
      "const": "0.1"
    },
    "capabilityId": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{2,100}$"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "job": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "domains": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "inputs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          }
        }
      }
    },
    "outputs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    },
    "runtime": {
      "type": "object",
      "required": [
        "platform"
      ],
      "properties": {
        "platform": {
          "type": "string"
        },
        "version": {
          "type": [
            "string",
            "null"
          ]
        },
        "requirements": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "dataSensitivity": {
      "enum": [
        "public",
        "internal",
        "sensitive",
        "regulated",
        "unknown"
      ]
    },
    "sideEffects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "approvalBoundary": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "verification": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "enum": [
            "UNTESTED",
            "STRUCTURAL",
            "PARTIAL",
            "VERIFIED",
            "BLOCKED"
          ]
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "license": {
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "seller": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        }
      }
    },
    "dependencies": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "monetization": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "enum": [
            "FREE",
            "ONE_TIME",
            "SUBSCRIPTION",
            "REQUEST_ONLY",
            "EXTERNAL"
          ]
        },
        "price": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "canonicalUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    }
  }
}
