{
  "schemaVersion": 1,
  "id": "org.openpatch.metrocare-service-navigator",
  "name": "MetroCare: personal service navigator",
  "summary": "Adds private search, access filters, and side-by-side service comparison to a dense healthcare directory while preserving the user's preferences.",
  "version": "1.1.0",
  "author": { "name": "OpenPatch Community", "verified": false },
  "match": {
    "hosts": ["localhost", "127.0.0.1", "openpatch-tau.vercel.app"],
    "paths": ["/care/*"]
  },
  "capabilities": [
    "content-filter",
    "content-compare",
    "accessibility",
    "keyboard-navigation",
    "local-storage",
    "layout",
    "hide-elements",
    "reorganize"
  ],
  "operations": [
    {
      "id": "add-private-service-navigator",
      "type": "collectionFilter",
      "selector": "#care-directory",
      "items": ".care-service",
      "title": "Find care that fits you",
      "description": "Search and combine access, language, and availability needs without sending anything to MetroCare or OpenPatch.",
      "search": {
        "label": "Search services",
        "placeholder": "Try therapy, dentist, family doctor…",
        "attributes": ["data-service-name", "data-keywords"]
      },
      "filters": [
        {
          "id": "need",
          "label": "Type of care",
          "attribute": "data-need",
          "options": [
            { "value": "primary-care", "label": "Primary care" },
            { "value": "mental-health", "label": "Mental health" },
            { "value": "dental", "label": "Dental care" },
            { "value": "pharmacy", "label": "Pharmacy support" },
            { "value": "family-support", "label": "Family support" }
          ]
        },
        {
          "id": "access",
          "label": "Access need",
          "attribute": "data-access",
          "options": [
            { "value": "wheelchair", "label": "Wheelchair access" },
            { "value": "sensory-friendly", "label": "Sensory-friendly" },
            { "value": "telehealth", "label": "Telehealth" },
            { "value": "home-visit", "label": "Home visits" }
          ]
        },
        {
          "id": "language",
          "label": "Language",
          "attribute": "data-languages",
          "options": [
            { "value": "urdu", "label": "Urdu" },
            { "value": "spanish", "label": "Spanish" },
            { "value": "asl", "label": "ASL" }
          ]
        },
        {
          "id": "availability",
          "label": "Availability",
          "attribute": "data-availability",
          "options": [
            { "value": "today", "label": "Available today" },
            { "value": "this-week", "label": "Available this week" },
            { "value": "new-patients", "label": "Accepting new patients" }
          ]
        }
      ],
      "persist": { "key": "service-needs-v1", "ttlMinutes": 1440 }
    },
    {
      "id": "add-private-service-comparison",
      "type": "collectionCompare",
      "selector": "#care-directory",
      "items": ".care-service",
      "title": "Compare care without being tracked",
      "description": "Select 2 or 3 services for a private side-by-side view. Nothing leaves this page.",
      "itemTitleAttribute": "data-service-name",
      "maxItems": 3,
      "fields": [
        {
          "id": "care",
          "label": "Type of care",
          "attribute": "data-need",
          "values": [
            { "value": "primary-care", "label": "Primary care" },
            { "value": "mental-health", "label": "Mental health" },
            { "value": "dental", "label": "Dental care" },
            { "value": "pharmacy", "label": "Pharmacy support" },
            { "value": "family-support", "label": "Family support" }
          ]
        },
        {
          "id": "access",
          "label": "Access options",
          "attribute": "data-access",
          "values": [
            { "value": "wheelchair", "label": "Wheelchair access" },
            { "value": "sensory-friendly", "label": "Sensory-friendly" },
            { "value": "telehealth", "label": "Telehealth" },
            { "value": "home-visit", "label": "Home visits" },
            { "value": "delivery", "label": "Delivery" }
          ]
        },
        {
          "id": "languages",
          "label": "Languages",
          "attribute": "data-languages",
          "values": [
            { "value": "english", "label": "English" },
            { "value": "urdu", "label": "Urdu" },
            { "value": "spanish", "label": "Spanish" },
            { "value": "asl", "label": "ASL" }
          ]
        },
        {
          "id": "availability",
          "label": "Availability",
          "attribute": "data-availability",
          "values": [
            { "value": "today", "label": "Available today" },
            { "value": "this-week", "label": "Available this week" },
            { "value": "new-patients", "label": "Accepting new patients" }
          ]
        }
      ]
    },
    {
      "id": "hide-newsletter-promotion",
      "type": "hide",
      "selector": ".care-community-promo"
    },
    {
      "id": "move-human-help-near-results",
      "type": "move",
      "selector": ".care-urgent",
      "target": "#care-directory",
      "position": "before"
    },
    {
      "id": "label-directory-region",
      "type": "attributes",
      "selector": "#care-directory",
      "attributes": { "role": "region", "aria-label": "Filtered community care services" }
    },
    {
      "id": "label-results-list",
      "type": "attributes",
      "selector": ".care-service-grid",
      "attributes": { "role": "list", "aria-label": "Matching care services" }
    },
    {
      "id": "label-service-items",
      "type": "attributes",
      "selector": ".care-service",
      "attributes": { "role": "listitem" }
    },
    {
      "id": "strengthen-result-cards",
      "type": "style",
      "selector": ".care-service",
      "styles": {
        "border-color": "#cfe1d8",
        "border-radius": "16px",
        "box-shadow": "0 12px 30px rgba(29, 77, 58, .07)"
      }
    },
    {
      "id": "mobile-stack-workspace",
      "type": "style",
      "selector": ".care-layout",
      "when": { "maxWidth": 760 },
      "styles": {
        "display": "flex",
        "flex-direction": "column",
        "gap": "24px",
        "width": "100%"
      }
    },
    {
      "id": "mobile-directory-width",
      "type": "style",
      "selector": ".care-main",
      "when": { "maxWidth": 760 },
      "styles": { "width": "100%", "min-width": "0" }
    },
    {
      "id": "mobile-compact-navigation",
      "type": "style",
      "selector": ".care-sidebar",
      "when": { "maxWidth": 760 },
      "styles": {
        "position": "relative",
        "top": "0",
        "width": "100%",
        "grid-template-columns": "minmax(0, 1fr) minmax(0, 1fr)",
        "gap": "16px"
      }
    }
  ],
  "verify": [
    { "type": "exists", "selector": "#care-directory", "min": 1, "max": 1 },
    { "type": "exists", "selector": ".care-service", "min": 12, "max": 12 },
    { "type": "exists", "selector": ".openpatch-navigator", "min": 1, "max": 1 },
    { "type": "exists", "selector": ".openpatch-navigator input[type='search']", "min": 1, "max": 1 },
    { "type": "exists", "selector": ".openpatch-navigator select", "min": 4, "max": 4 },
    { "type": "exists", "selector": ".openpatch-compare", "min": 1, "max": 1 },
    { "type": "exists", "selector": ".openpatch-compare__select", "min": 12, "max": 12 },
    { "type": "attribute", "selector": "#care-directory", "name": "role", "value": "region" },
    { "type": "attribute", "selector": ".care-service-grid", "name": "role", "value": "list" },
    { "type": "attribute", "selector": ".care-community-promo", "name": "aria-hidden", "value": "true" }
  ],
  "changelog": "Adds a trusted private comparison workflow for up to three services, with an accessible side-by-side table generated only from declared data attributes. Retains private multi-facet search, locally saved preferences, result announcements, keyboard support, structural semantics, and mobile refinements."
}
