{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/answerline-dev/json-schema/answerline-dev-copilot-monitor-response-schema.json",
  "title": "CopilotMonitorResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/answerline-dev-openapi.json#/components/schemas/CopilotMonitorResponse",
  "required": [
    "success",
    "result"
  ],
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "result": {
      "description": "Data from Copilot's reply",
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "Text of Copilot's reply"
        },
        "html": {
          "type": "string",
          "format": "uri",
          "description": "Never present: include.html is refused for Copilot."
        },
        "sources": {
          "type": "array",
          "description": "Sources the response cites",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "number",
                "description": "Where the source sits in the response, as an index"
              },
              "url": {
                "type": "string",
                "description": "Link to the source"
              },
              "label": {
                "type": "string",
                "description": "Label shown for this source"
              },
              "description": {
                "type": "string",
                "description": "Text describing what the source contains"
              }
            }
          }
        },
        "citationPills": {
          "type": "array",
          "description": "Citation pills that appear inline in the Copilot answer. Every element pairs one pill with one source: a pill backed by N sources (a chip made from consecutive citation events) yields N elements with the same `citationPillId`, each holding that source's own `label`, `url` and `domain`. Grouping by `citationPillId` rebuilds the pills. Not present in `result` if the answer has no pills.",
          "items": {
            "type": "object",
            "required": [
              "label",
              "citationPillId",
              "url",
              "domain",
              "position"
            ],
            "properties": {
              "label": {
                "type": "string",
                "description": "Title of this individual source, taken from the citation event (for instance `\"Microsoft 365 Documentation\"`, `\"Productivity Best Practices\"`). Never missing, but can be an empty string if the event carries no title — in that case identify the source by `domain` / `url`. Entries that share a `citationPillId` each have their own per-source label."
              },
              "citationPillId": {
                "type": "integer",
                "description": "One-based number common to every entry that comes from one chip. Grouping on `citationPillId` rebuilds the chip as displayed; each entry's `label` is specific to its source, so it varies inside a chip."
              },
              "url": {
                "type": "string",
                "description": "Link straight to the cited source."
              },
              "domain": {
                "type": "string",
                "description": "Hostname taken from `url`, useful for grouping and display."
              },
              "description": {
                "type": "string",
                "description": "Source snippet shown in the sources rail, if Copilot supplies one; otherwise omitted."
              },
              "position": {
                "type": "integer",
                "description": "Index of this source within the sibling `result.sources` array, starting at 1."
              }
            }
          }
        },
        "shoppingCards": {
          "type": "array",
          "description": "Shopping/product cards parsed from the response (if any)",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of shopping card"
              },
              "layout": {
                "type": "string",
                "description": "Visual layout used for the shopping card"
              },
              "products": {
                "type": "array",
                "description": "List of product details",
                "items": {
                  "type": "object",
                  "properties": {
                    "product": {
                      "type": "object",
                      "description": "Identifiers for the product",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Product's unique ID"
                        },
                        "groupId": {
                          "type": "string",
                          "description": "ID of the product group"
                        },
                        "brandGroupId": {
                          "type": "string",
                          "description": "ID of the brand group (optional)"
                        }
                      }
                    },
                    "position": {
                      "type": "integer",
                      "description": "Rank starting at 1, counted over every product in every shopping card of the response (one continuous sequence that does not restart for each card)."
                    },
                    "offerId": {
                      "type": "string",
                      "description": "Identifier unique to the offer"
                    },
                    "url": {
                      "type": "string",
                      "description": "URL of the product page"
                    },
                    "name": {
                      "type": "string",
                      "description": "Product name"
                    },
                    "description": {
                      "type": "string",
                      "description": "Product description"
                    },
                    "images": {
                      "type": "array",
                      "description": "Product images, each with a title and URL",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string",
                            "description": "Image title"
                          },
                          "url": {
                            "type": "string",
                            "description": "Image URL"
                          }
                        }
                      }
                    },
                    "specifications": {
                      "type": "array",
                      "description": "Product attributes such as Color or Size",
                      "items": {
                        "type": "object",
                        "properties": {
                          "displayName": {
                            "type": "string",
                            "description": "Specification name"
                          },
                          "values": {
                            "type": "array",
                            "description": "Available values",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "tags": {
                      "type": "array",
                      "description": "Product tags",
                      "items": {
                        "type": "string"
                      }
                    },
                    "price": {
                      "type": "object",
                      "description": "Pricing details for the product",
                      "properties": {
                        "amount": {
                          "type": "number",
                          "description": "Price amount"
                        },
                        "currency": {
                          "type": "string",
                          "description": "Code of the currency, if given"
                        },
                        "currencySymbol": {
                          "type": "string",
                          "description": "Currency symbol"
                        }
                      }
                    },
                    "seller": {
                      "type": "string",
                      "description": "Seller name"
                    },
                    "sellerLogoUrl": {
                      "type": "string",
                      "description": "URL of the seller's logo"
                    },
                    "brandName": {
                      "type": "string",
                      "description": "Brand of the product"
                    },
                    "rating": {
                      "type": "object",
                      "description": "Rating details for the product",
                      "properties": {
                        "value": {
                          "type": "number",
                          "description": "Rating value"
                        },
                        "count": {
                          "type": "integer",
                          "description": "Rating count"
                        }
                      }
                    },
                    "canTrackPrice": {
                      "type": "boolean",
                      "description": "Indicates if price tracking is offered"
                    }
                  }
                }
              }
            }
          }
        },
        "map": {
          "type": "array",
          "description": "Map entries for businesses or places parsed from the response (if any)",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Business name"
              },
              "position": {
                "type": "integer",
                "description": "Rank in the results (1-indexed)"
              },
              "placeId": {
                "type": "string",
                "description": "Place ID on Google"
              },
              "location": {
                "type": "object",
                "description": "Business location",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Complete street address"
                  },
                  "latitude": {
                    "type": "number",
                    "description": "GPS latitude"
                  },
                  "longitude": {
                    "type": "number",
                    "description": "GPS longitude"
                  }
                }
              },
              "phoneNumber": {
                "type": "string",
                "description": "Phone number for contact"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "URL of the business's website"
              },
              "reviews": {
                "type": "array",
                "description": "Aggregated review data from providers",
                "items": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "description": "Review count"
                    },
                    "rating": {
                      "type": "number",
                      "description": "Average rating"
                    },
                    "providerName": {
                      "type": "string",
                      "description": "Name of the review provider"
                    },
                    "providerIconUrl": {
                      "type": "string",
                      "description": "URL of the provider's icon"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "URL of the reviews page"
                    }
                  }
                }
              },
              "photos": {
                "type": "array",
                "description": "Business photos",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Photo URL"
                    },
                    "altText": {
                      "type": "string",
                      "description": "The photo's alt text"
                    },
                    "providerName": {
                      "type": "string",
                      "description": "Name of the photo provider"
                    },
                    "providerUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "URL of the photo provider"
                    }
                  }
                }
              },
              "openState": {
                "type": "string",
                "description": "Whether it is open or closed now"
              },
              "category": {
                "type": "string",
                "description": "Business category"
              },
              "price": {
                "description": "Price tier, if known"
              },
              "layerLabel": {
                "type": "string",
                "description": "Grouping label for the map layer"
              }
            }
          }
        },
        "searchQueries": {
          "type": "array",
          "description": "Query fan-out: the web searches Copilot performed as it wrote the response. Returned automatically whenever there is at least one, at no extra cost.",
          "items": {
            "type": "string"
          }
        },
        "markdown": {
          "type": "string",
          "description": "Copilot's reply as Markdown; returned only if include.markdown is true"
        },
        "rawResponse": {
          "type": "array",
          "description": "The answer as normalized stream events (present when include.rawResponse is true). For the engine's answer as received, use include.rawWire.",
          "items": {}
        }
      }
    }
  }
}