{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:sensorium-workbench.consent-descriptor:v1",
  "title": "sensorium-workbench.consent-descriptor.v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schema/v",
    "reason/code",
    "workspace/ref",
    "root/ref",
    "relative/path",
    "argv",
    "timeout_ms",
    "output/max-bytes",
    "egress",
    "credential/env"
  ],
  "properties": {
    "schema": { "const": "sensorium-workbench.consent-descriptor.v1" },
    "schema/v": { "const": 1 },
    "reason/code": { "$ref": "#/$defs/token" },
    "workspace/ref": { "$ref": "#/$defs/ref" },
    "root/ref": { "$ref": "#/$defs/ref" },
    "relative/path": { "type": "string", "minLength": 1, "maxLength": 4096 },
    "argv": {
      "type": "array",
      "minItems": 1,
      "maxItems": 64,
      "items": { "type": "string", "minLength": 1, "maxLength": 1024, "not": { "pattern": "\\u0000" } }
    },
    "argv/prefix": {
      "type": "array",
      "minItems": 1,
      "maxItems": 16,
      "items": { "type": "string", "minLength": 1, "maxLength": 1024, "not": { "pattern": "\\u0000" } }
    },
    "argv/allowed-variable-prefixes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 1, "maxLength": 128, "not": { "pattern": "\\u0000" } }
    },
    "profile/ref": { "$ref": "#/$defs/ref" },
    "timeout_ms": { "type": "integer", "minimum": 1 },
    "output/max-bytes": { "type": "integer", "minimum": 1 },
    "egress": { "enum": ["none", "denied"] },
    "credential/env": { "enum": ["none", "denied"] }
  },
  "dependentRequired": {
    "argv/allowed-variable-prefixes": ["argv/prefix"]
  },
  "$defs": {
    "ref": { "type": "string", "minLength": 1, "maxLength": 256, "not": { "pattern": "\\u0000" } },
    "token": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9.:_/-]+$" }
  },
  "x-dia-basis": ["doc/project/40-proposals/071-sensorium-workbench.md"]
}
