{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbitspace:tool-adapters:v1",
  "title": "Operator-installed CLI Tool adapters",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "tools"
  ],
  "properties": {
    "schema_version": {
      "const": "orbitspace.tool-adapters/v1"
    },
    "tools": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "binding",
          "name",
          "tool",
          "command"
        ],
        "properties": {
          "binding": {
            "type": "string",
            "maxLength": 512,
            "pattern": "^tool://[^/@?#]+/[^@?#]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9_-]+$"
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "command": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          },
          "artifact_kinds": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]*(?:\\.\\*)?$"
            }
          }
        }
      }
    }
  }
}
