{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/permissions.schema.json",
  "title": "Pending permission prompts",
  "description": "What GET /v1/permissions returns: the host permission prompts waiting on the user. available is false while the host records none where another process can read them; requests is then empty and reason says so. When available, each request names its session, the tool and a redacted summary.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "available", "reason", "requests"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "available": {
      "type": "boolean"
    },
    "reason": {
      "type": ["string", "null"]
    },
    "requests": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "sessionId", "tool", "summary", "at"],
        "properties": {
          "id": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "at": {
            "type": "string"
          }
        }
      }
    }
  }
}
