{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://roost.land/protocol/stays-protocol-v1.json",
  "title": "stays-protocol v1",
  "description": "Open standard for publishing bookable stays as JSON. Place at /stays.json on your domain. Aggregators discover via /.well-known/stays or rel=alternate link.",
  "type": "object",
  "required": ["protocol", "host", "stays"],
  "properties": {
    "protocol": { "const": "stays-protocol/1.0" },
    "host": {
      "type": "object",
      "required": ["id", "name", "domain"],
      "properties": {
        "id":        { "type": "string", "description": "Stable identifier (slug/reverse-DNS)" },
        "name":      { "type": "string" },
        "domain":    { "type": "string", "format": "uri" },
        "location":  { "type": "string", "description": "City, region, country" },
        "lat":       { "type": "number" },
        "lng":       { "type": "number" },
        "owner":     { "type": "string", "description": "Primary contact name(s)" },
        "email":     { "type": "string", "format": "email" },
        "phone":     { "type": "string" },
        "bio":       { "type": "string", "description": "1-2 paragraph about the host" },
        "founded":   { "type": "string", "format": "date" },
        "values":    { "type": "array", "items": { "type": "string" } },
        "channels":  { "type": "array", "items": { "type": "string" }, "description": "Other channels they list on, for transparency" }
      }
    },
    "stays": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name", "sleeps", "price_from", "book_url"],
        "properties": {
          "id":           { "type": "string" },
          "name":         { "type": "string" },
          "type":         { "type": "string", "description": "cabin · cottage · yurt · hut · caravan · room · bell-tent · etc" },
          "sleeps":       { "type": "integer", "minimum": 1 },
          "beds":         { "type": "string" },
          "price_from":   { "type": "number", "description": "Lowest nightly rate in currency below" },
          "price_currency": { "type": "string", "default": "GBP" },
          "min_nights":   { "type": "integer", "default": 1 },
          "description":  { "type": "string" },
          "amenities":    { "type": "array", "items": { "type": "string" } },
          "dogs":         { "type": "boolean" },
          "kids":         { "type": "boolean" },
          "off_grid":     { "type": "boolean" },
          "wifi":         { "type": "boolean" },
          "ical_url":     { "type": "string", "format": "uri", "description": "Public iCal export for availability" },
          "photos":       { "type": "array", "items": { "type": "string", "format": "uri" } },
          "book_url":     { "type": "string", "format": "uri", "description": "Direct booking URL on host's site · zero middleman" },
          "tags":         { "type": "array", "items": { "type": "string" } }
        }
      }
    },
    "cooperative": {
      "type": "object",
      "description": "If host is a roost-cooperative member, declare here",
      "properties": {
        "member":    { "type": "boolean" },
        "member_id": { "type": "string" },
        "since":     { "type": "string", "format": "date" }
      }
    },
    "signature": {
      "type": "string",
      "description": "Optional Ed25519 signature over the manifest hash for verifiable provenance"
    }
  }
}
