{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:jellybox:interface:1.0:result:list_contexts",
  "title": "Jellybox 1.0 — list_contexts result",
  "$defs": {
    "AspectRef": {
      "additionalProperties": false,
      "properties": {
        "aspectId": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "entityId": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "target": {
          "$ref": "#/$defs/Target"
        }
      },
      "required": [
        "target",
        "entityId",
        "aspectId"
      ],
      "type": "object"
    },
    "Binding": {
      "additionalProperties": false,
      "properties": {
        "capabilityUse": {
          "$ref": "#/$defs/EntityRef"
        },
        "capabilityUseRevision": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "contextRef": {
          "$ref": "#/$defs/EntityRef"
        },
        "descriptorRevision": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "selectionRevision": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "target": {
          "$ref": "#/$defs/Target"
        }
      },
      "required": [
        "target",
        "contextRef",
        "selectionRevision",
        "descriptorRevision"
      ],
      "type": "object",
      "dependentRequired": {
        "capabilityUse": [
          "capabilityUseRevision"
        ],
        "capabilityUseRevision": [
          "capabilityUse"
        ]
      }
    },
    "EntityRef": {
      "additionalProperties": false,
      "properties": {
        "entityId": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "target": {
          "$ref": "#/$defs/Target"
        }
      },
      "required": [
        "target",
        "entityId"
      ],
      "type": "object"
    },
    "RevisionCheck": {
      "additionalProperties": false,
      "properties": {
        "ref": {
          "$ref": "#/$defs/SubjectRef"
        },
        "revision": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "ref",
        "revision"
      ],
      "type": "object"
    },
    "SubjectRef": {
      "oneOf": [
        {
          "$ref": "#/$defs/EntityRef"
        },
        {
          "$ref": "#/$defs/AspectRef"
        }
      ]
    },
    "Target": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "instanceId": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "kind": {
          "enum": [
            "jellybox",
            "jellyhub"
          ]
        }
      },
      "required": [
        "kind",
        "id",
        "instanceId"
      ],
      "type": "object"
    },
    "Reason": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Availability": {
      "type": "object",
      "properties": {
        "available": {
          "type": "boolean"
        },
        "reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Reason"
          }
        }
      },
      "required": [
        "available",
        "reasons"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "available": {
                "const": false
              }
            }
          },
          "then": {
            "properties": {
              "reasons": {
                "minItems": 1
              }
            }
          }
        }
      ]
    },
    "ContextState": {
      "type": "object",
      "properties": {
        "contextRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "selectionRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "viewRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "defaultViewRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "presentationRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "unavailableReason": {
          "anyOf": [
            {
              "$ref": "#/$defs/Reason"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "contextRef",
        "selectionRevision",
        "viewRef",
        "defaultViewRef",
        "presentationRevision",
        "unavailableReason"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "contextRef": {
                "type": "null"
              }
            }
          },
          "then": {
            "properties": {
              "unavailableReason": {
                "$ref": "#/$defs/Reason"
              },
              "defaultViewRef": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "unavailableReason": {
                "type": "null"
              }
            }
          }
        }
      ]
    },
    "Effect": {
      "type": "object",
      "properties": {
        "scope": {
          "enum": [
            "application",
            "selection",
            "presentation",
            "external"
          ]
        },
        "refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SubjectRef"
          }
        },
        "outcome": {
          "enum": [
            "applied",
            "not_applied",
            "unknown"
          ]
        },
        "revisions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RevisionCheck"
          }
        }
      },
      "required": [
        "scope",
        "refs",
        "outcome",
        "revisions"
      ]
    },
    "Error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Envelope": {
      "type": "object",
      "properties": {
        "protocolVersion": {
          "const": "1.0"
        },
        "status": {
          "enum": [
            "completed",
            "rejected",
            "cancelled",
            "failed"
          ]
        },
        "data": {},
        "effects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Effect"
          }
        },
        "target": {
          "$ref": "#/$defs/Target"
        },
        "interactionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "requestId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "context": {
          "$ref": "#/$defs/ContextState"
        },
        "error": {
          "$ref": "#/$defs/Error"
        },
        "presentationWarnings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Reason"
          }
        },
        "receipt": {
          "$ref": "#/$defs/Receipt"
        }
      },
      "required": [
        "protocolVersion",
        "status",
        "data",
        "effects"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "enum": [
                  "rejected",
                  "cancelled",
                  "failed"
                ]
              }
            }
          },
          "then": {
            "required": [
              "error"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "not": {
              "required": [
                "error"
              ]
            },
            "properties": {
              "effects": {
                "items": {
                  "properties": {
                    "outcome": {
                      "enum": [
                        "applied",
                        "not_applied"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "enum": [
                  "rejected",
                  "cancelled"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "effects": {
                "items": {
                  "properties": {
                    "outcome": {
                      "const": "not_applied"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "receipt"
            ],
            "properties": {
              "receipt": {
                "properties": {
                  "state": {
                    "const": "running"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "status": {
                "const": "failed"
              },
              "data": {
                "type": "null"
              },
              "error": {
                "properties": {
                  "code": {
                    "const": "request_in_progress"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "receipt"
            ],
            "properties": {
              "receipt": {
                "properties": {
                  "state": {
                    "const": "unresolved"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "status": {
                "const": "failed"
              },
              "data": {
                "type": "null"
              },
              "error": {
                "properties": {
                  "code": {
                    "const": "outcome_unresolved"
                  }
                }
              },
              "effects": {
                "contains": {
                  "properties": {
                    "outcome": {
                      "const": "unknown"
                    }
                  },
                  "required": [
                    "outcome"
                  ]
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "receipt"
            ],
            "properties": {
              "receipt": {
                "properties": {
                  "state": {
                    "const": "terminal"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "effects": {
                "items": {
                  "properties": {
                    "outcome": {
                      "enum": [
                        "applied",
                        "not_applied"
                      ]
                    }
                  }
                }
              },
              "error": {
                "properties": {
                  "code": {
                    "not": {
                      "enum": [
                        "request_in_progress",
                        "outcome_unresolved"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "properties": {
                  "code": {
                    "const": "output_validation_failed"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "status": {
                "const": "failed"
              },
              "data": {
                "type": "null"
              },
              "effects": {
                "items": {
                  "properties": {
                    "outcome": {
                      "enum": [
                        "applied",
                        "not_applied"
                      ]
                    }
                  }
                }
              },
              "receipt": {
                "properties": {
                  "state": {
                    "const": "terminal"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "properties": {
                  "code": {
                    "enum": [
                      "request_in_progress",
                      "outcome_unresolved"
                    ]
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          },
          "then": {
            "required": [
              "receipt",
              "requestId"
            ]
          }
        }
      ],
      "dependentRequired": {
        "receipt": [
          "requestId"
        ],
        "requestId": [
          "receipt"
        ]
      }
    },
    "ContextSummary": {
      "type": "object",
      "properties": {
        "ref": {
          "$ref": "#/$defs/EntityRef"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "availability": {
          "$ref": "#/$defs/Availability"
        },
        "description": {
          "type": "string"
        },
        "viewRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "ref",
        "title",
        "revision",
        "availability"
      ]
    },
    "ActionSummary": {
      "type": "object",
      "properties": {
        "ref": {
          "$ref": "#/$defs/EntityRef"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "summary": {
          "type": "string",
          "minLength": 1
        },
        "availability": {
          "$ref": "#/$defs/Availability"
        }
      },
      "required": [
        "ref",
        "title",
        "revision",
        "summary",
        "availability"
      ]
    },
    "Descriptor": {
      "type": "object",
      "properties": {
        "ref": {
          "$ref": "#/$defs/EntityRef"
        },
        "revision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "operation": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "id"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "inputSchema": {
          "type": [
            "object",
            "boolean"
          ]
        },
        "outputSchema": {
          "type": [
            "object",
            "boolean"
          ]
        },
        "availability": {
          "$ref": "#/$defs/DescriptorAvailability"
        },
        "binding": {
          "$ref": "#/$defs/Binding"
        },
        "effects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeclaredEffect"
          }
        },
        "preconditions": {
          "$ref": "#/$defs/PreconditionContract"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Coordinate"
          }
        },
        "completion": {
          "$ref": "#/$defs/Completion"
        },
        "atomicity": {
          "enum": [
            "atomic",
            "best-effort"
          ]
        },
        "retry": {
          "type": "object",
          "properties": {
            "policy": {
              "enum": [
                "idempotent",
                "request-id-required"
              ]
            }
          },
          "required": [
            "policy"
          ]
        },
        "concurrency": {
          "$ref": "#/$defs/Concurrency"
        },
        "authorization": {
          "$ref": "#/$defs/Authorization"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Extension"
          }
        }
      },
      "required": [
        "ref",
        "revision",
        "operation",
        "title",
        "description",
        "inputSchema",
        "outputSchema",
        "availability",
        "binding",
        "effects",
        "preconditions",
        "coordinates",
        "completion",
        "atomicity",
        "retry",
        "concurrency",
        "authorization",
        "extensions"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "retry": {
                "properties": {
                  "policy": {
                    "const": "idempotent"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "effects": {
                "maxItems": 0
              }
            }
          }
        }
      ]
    },
    "Result_readme": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "$ref": "#/$defs/ReadmeData"
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_current_context": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "$ref": "#/$defs/ContextState"
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_list_contexts": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/ContextSummary"
                    }
                  },
                  "nextCursor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "items",
                  "nextCursor"
                ]
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_enter_context": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "$ref": "#/$defs/ContextState"
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_list_actions": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/ActionSummary"
                    }
                  },
                  "nextCursor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "items",
                  "nextCursor"
                ]
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_describe_actions": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "actions": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "$ref": "#/$defs/Descriptor"
                    }
                  }
                },
                "required": [
                  "actions"
                ]
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "Result_perform_action": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {}
            }
          }
        }
      ]
    },
    "Result_navigate_to_view": {
      "allOf": [
        {
          "$ref": "#/$defs/Envelope"
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "completed"
              }
            }
          },
          "then": {
            "required": [
              "target",
              "interactionId",
              "context"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "viewRef": {
                    "$ref": "#/$defs/EntityRef"
                  },
                  "context": {
                    "$ref": "#/$defs/ContextState"
                  }
                },
                "required": [
                  "viewRef",
                  "context"
                ]
              }
            }
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "receipt"
                ]
              },
              {
                "required": [
                  "requestId"
                ]
              }
            ]
          }
        }
      ]
    },
    "DeclaredEffect": {
      "type": "object",
      "properties": {
        "scope": {
          "enum": [
            "application",
            "selection",
            "presentation",
            "external"
          ]
        },
        "refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SubjectRef"
          }
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "scope",
        "refs",
        "description"
      ]
    },
    "Receipt": {
      "type": "object",
      "properties": {
        "state": {
          "enum": [
            "running",
            "unresolved",
            "terminal"
          ]
        }
      },
      "required": [
        "state"
      ]
    },
    "AvailabilityBasis": {
      "type": "object",
      "properties": {
        "contextRef": {
          "$ref": "#/$defs/EntityRef"
        },
        "selectionRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "descriptorRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "required": [
        "contextRef",
        "selectionRevision",
        "descriptorRevision"
      ]
    },
    "DescriptorAvailability": {
      "allOf": [
        {
          "$ref": "#/$defs/Availability"
        },
        {
          "required": [
            "basis"
          ],
          "properties": {
            "basis": {
              "$ref": "#/$defs/AvailabilityBasis"
            }
          }
        }
      ]
    },
    "PreconditionContract": {
      "type": "object",
      "properties": {
        "mode": {
          "enum": [
            "none",
            "fixed",
            "resolved"
          ]
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RevisionCheck"
          },
          "maxItems": 100
        },
        "resolverActionRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "mode",
        "checks",
        "resolverActionRef"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "mode": {
                "const": "none"
              }
            }
          },
          "then": {
            "properties": {
              "checks": {
                "maxItems": 0
              },
              "resolverActionRef": {
                "type": "null"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "fixed"
              }
            }
          },
          "then": {
            "properties": {
              "checks": {
                "minItems": 1
              },
              "resolverActionRef": {
                "type": "null"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "resolved"
              }
            }
          },
          "then": {
            "properties": {
              "checks": {
                "maxItems": 0
              },
              "resolverActionRef": {
                "$ref": "#/$defs/EntityRef"
              }
            }
          }
        }
      ]
    },
    "Coordinate": {
      "type": "object",
      "properties": {
        "schemaPointer": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "context-ref",
            "action-ref",
            "view-ref",
            "entity-ref",
            "aspect-ref",
            "opaque-id"
          ]
        },
        "scope": {
          "enum": [
            "target-instance",
            "context",
            "application"
          ]
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "schemaPointer",
        "kind",
        "scope",
        "description"
      ]
    },
    "Completion": {
      "type": "object",
      "properties": {
        "condition": {
          "enum": [
            "returned",
            "committed",
            "submitted"
          ]
        },
        "persistence": {
          "enum": [
            "none",
            "instance",
            "durable"
          ]
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "verificationActionRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "condition",
        "persistence",
        "description",
        "verificationActionRef"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "condition": {
                "const": "submitted"
              }
            }
          },
          "then": {
            "properties": {
              "verificationActionRef": {
                "$ref": "#/$defs/EntityRef"
              }
            }
          }
        }
      ]
    },
    "Concurrency": {
      "type": "object",
      "properties": {
        "strategy": {
          "enum": [
            "serialized",
            "precondition-checked",
            "snapshot",
            "best-effort"
          ]
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "strategy",
        "description"
      ]
    },
    "Authorization": {
      "type": "object",
      "properties": {
        "confirmation": {
          "enum": [
            "none",
            "possible",
            "required"
          ]
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "confirmation",
        "description"
      ]
    },
    "Extension": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "required": {
          "type": "boolean"
        },
        "data": {}
      },
      "required": [
        "id",
        "required",
        "data"
      ]
    },
    "View": {
      "type": "object",
      "properties": {
        "ref": {
          "$ref": "#/$defs/EntityRef"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "defaultContextRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "availability": {
          "$ref": "#/$defs/Availability"
        },
        "lifetimeEffect": {
          "enum": [
            "preserves-instance",
            "ends-instance"
          ]
        }
      },
      "required": [
        "ref",
        "title",
        "description",
        "defaultContextRef",
        "availability",
        "lifetimeEffect"
      ]
    },
    "ViewDiscoveryAction": {
      "type": "object",
      "properties": {
        "contextRef": {
          "$ref": "#/$defs/EntityRef"
        },
        "actionRef": {
          "$ref": "#/$defs/EntityRef"
        }
      },
      "required": [
        "contextRef",
        "actionRef"
      ]
    },
    "ViewCatalogue": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/View"
          }
        },
        "complete": {
          "type": "boolean"
        },
        "discovery": {
          "anyOf": [
            {
              "$ref": "#/$defs/ViewDiscoveryAction"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "items",
        "complete",
        "discovery"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "complete": {
                "const": true
              }
            }
          },
          "then": {
            "properties": {
              "discovery": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "discovery": {
                "$ref": "#/$defs/ViewDiscoveryAction"
              }
            }
          }
        }
      ]
    },
    "Lifecycle": {
      "type": "object",
      "properties": {
        "interactionLifetime": {
          "type": "object",
          "properties": {
            "idleSeconds": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "maximumSeconds": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "idleSeconds",
            "maximumSeconds"
          ]
        },
        "preservesAcrossReload": {
          "type": "boolean"
        },
        "preservesAcrossRestart": {
          "type": "boolean"
        },
        "receiptRetention": {
          "const": "interaction-lifetime"
        },
        "initialContextRef": {
          "$ref": "#/$defs/EntityRef"
        },
        "fallbackContextRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "interactionLifetime",
        "preservesAcrossReload",
        "preservesAcrossRestart",
        "receiptRetention",
        "initialContextRef",
        "fallbackContextRef"
      ]
    },
    "Guidance": {
      "type": "object",
      "properties": {
        "contexts": {
          "type": "string",
          "minLength": 1
        },
        "actions": {
          "type": "string",
          "minLength": 1
        },
        "presentation": {
          "type": "string",
          "minLength": 1
        },
        "unavailable": {
          "type": "string",
          "minLength": 1
        },
        "lifetime": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "contexts",
        "actions",
        "presentation",
        "unavailable",
        "lifetime"
      ]
    },
    "ReadmeData": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "interfaceEdition": {
          "const": "1.0"
        },
        "interfaceProfile": {
          "const": "standalone-core"
        },
        "tools": {
          "type": "array",
          "items": {
            "enum": [
              "readme",
              "current_context",
              "list_contexts",
              "enter_context",
              "list_actions",
              "describe_actions",
              "perform_action",
              "navigate_to_view"
            ]
          },
          "minItems": 8,
          "maxItems": 8,
          "uniqueItems": true
        },
        "guidance": {
          "$ref": "#/$defs/Guidance"
        },
        "lifecycle": {
          "$ref": "#/$defs/Lifecycle"
        },
        "views": {
          "$ref": "#/$defs/ViewCatalogue"
        }
      },
      "required": [
        "name",
        "version",
        "interfaceEdition",
        "interfaceProfile",
        "tools",
        "guidance",
        "lifecycle",
        "views"
      ]
    }
  },
  "$ref": "#/$defs/Result_list_contexts"
}
