{
  "name": "ch89_change_watch",
  "title": "ch 89 · change watch",
  "description": "Checks one page, feed or listing against the last snapshot and says whether anything changed. Inputs: A link (page, RSS/Atom feed or JSON list), what to watch (price, stock, text or list), and last time's snapshot. Outputs: changed, notify, before/after diffs with quotes, and a new snapshot to keep.",
  "transport": {
    "kind": "http",
    "method": "POST",
    "url": "https://ch21.ai/api/public/channel/change-watch/take",
    "headers": {
      "authorization": "Bearer <ch21 feed key>",
      "content-type": "application/json"
    }
  },
  "inputSchema": {
    "type": "object",
    "required": [
      "notes"
    ],
    "properties": {
      "notes": {
        "type": "string",
        "description": "what you want this channel to do, in plain english"
      },
      "prior": {
        "type": "object",
        "properties": {
          "brief": {
            "type": "string"
          },
          "output": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "input": {
        "type": "object",
        "required": [
          "url",
          "watch"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "watch": {
            "enum": [
              "price",
              "stock",
              "text",
              "list"
            ]
          },
          "selector_hint": {
            "type": "string",
            "description": "words near the thing to watch, e.g. product name or 'Return policy'"
          },
          "baseline": {
            "type": "object",
            "description": "the snapshot returned last time; omit on first run"
          },
          "threshold": {
            "type": "object",
            "properties": {
              "price_drop_pct": {
                "type": "number"
              },
              "price_below": {
                "type": "number"
              }
            }
          },
          "quiet_if_unchanged": {
            "type": "boolean",
            "default": true
          }
        }
      }
    }
  }
}