{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/wheresmycoleslaw/capability/blob/main/capability-bridge.schema.json",
  "title": "Capability Sidecar Bridge",
  "description": "A machine-readable binding from an existing external executable surface to a Capability contract without requiring the upstream project to be rewritten.",
  "type": "object",
  "additionalProperties": false,
  "required": ["bridgeVersion", "manifest", "target", "authority"],
  "properties": {
    "bridgeVersion": { "const": "0.1" },
    "manifest": { "$ref": "./capability-manifest.schema.json" },
    "target": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kind", "package", "version", "bin", "binPath"],
      "properties": {
        "kind": { "const": "npm-cli" },
        "package": { "type": "string", "minLength": 1 },
        "version": { "type": "string", "minLength": 1 },
        "bin": { "type": "string", "minLength": 1 },
        "binPath": { "type": "string", "minLength": 1 }
      }
    },
    "authority": {
      "type": "object",
      "additionalProperties": false,
      "required": ["complete"],
      "properties": {
        "complete": { "type": "boolean" },
        "note": { "type": "string" }
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": true
    }
  }
}
