{
  "id": "com.lattice.trips",
  "name": "Trips",
  "icon": "↗",
  "color": "#2563eb",
  "description": "Plan trips with dated itineraries and packing checklists.",
  "requested_permissions": {
    "storage": [
      "sql"
    ],
    "network": {
      "allowlist": []
    },
    "events": {
      "trip-created": {
        "description": "A trip was created.",
        "schema": {
          "type": "object",
          "properties": {
            "trip_id": {
              "type": "string",
              "description": "Trip UUID.",
              "minLength": 1
            },
            "title": {
              "type": "string",
              "description": "Trip title.",
              "minLength": 1
            },
            "destination": {
              "type": "string",
              "description": "Destination name.",
              "minLength": 1
            },
            "start_date": {
              "type": "string",
              "description": "Inclusive trip start, destination-local YYYY-MM-DD.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "end_date": {
              "type": "string",
              "description": "Inclusive trip end, destination-local YYYY-MM-DD; on or after start_date.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "created_at": {
              "type": "string",
              "description": "Creation time, UTC ISO 8601 timestamp.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          "required": [
            "trip_id",
            "title",
            "destination",
            "start_date",
            "end_date",
            "created_at"
          ],
          "additionalProperties": false
        }
      },
      "item-added": {
        "description": "An itinerary item was added.",
        "schema": {
          "type": "object",
          "properties": {
            "item_id": {
              "type": "string",
              "description": "Itinerary item UUID.",
              "minLength": 1
            },
            "trip_id": {
              "type": "string",
              "description": "Trip UUID.",
              "minLength": 1
            },
            "kind": {
              "type": "string",
              "description": "Itinerary category.",
              "enum": [
                "flight",
                "lodging",
                "activity"
              ]
            },
            "title": {
              "type": "string",
              "description": "Itinerary item title.",
              "minLength": 1
            },
            "date": {
              "type": "string",
              "description": "Itinerary date, destination-local YYYY-MM-DD; within inclusive trip dates.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "time": {
              "type": "string",
              "description": "Destination-local HH:MM; empty means no time.",
              "pattern": "^(|([01]\\d|2[0-3]):[0-5]\\d)$"
            },
            "location": {
              "type": "string",
              "description": "Place or address; empty means none."
            },
            "confirmation_code": {
              "type": "string",
              "description": "Booking reference; empty means none."
            },
            "created_at": {
              "type": "string",
              "description": "Creation time, UTC ISO 8601 timestamp.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          "required": [
            "item_id",
            "trip_id",
            "kind",
            "title",
            "date",
            "time",
            "location",
            "confirmation_code",
            "created_at"
          ],
          "additionalProperties": false
        }
      },
      "packing-item-checked": {
        "description": "A packing item changed from unpacked to packed.",
        "schema": {
          "type": "object",
          "properties": {
            "packing_item_id": {
              "type": "string",
              "description": "Packing item UUID.",
              "minLength": 1
            },
            "trip_id": {
              "type": "string",
              "description": "Trip UUID.",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "description": "Packing item name.",
              "minLength": 1
            },
            "quantity": {
              "type": "integer",
              "description": "Positive number of pieces.",
              "minimum": 1,
              "maximum": 999
            },
            "checked": {
              "type": "boolean",
              "const": true,
              "description": "True when marked packed."
            },
            "checked_at": {
              "type": "string",
              "description": "Packing time, UTC ISO 8601 timestamp.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          "required": [
            "packing_item_id",
            "trip_id",
            "label",
            "quantity",
            "checked",
            "checked_at"
          ],
          "additionalProperties": false
        }
      }
    },
    "listeners": {
      "add-itinerary-item": {
        "description": "Add an itinerary item to an existing trip.",
        "schema": {
          "type": "object",
          "properties": {
            "trip_id": {
              "type": "string",
              "description": "Trip UUID.",
              "minLength": 1
            },
            "kind": {
              "type": "string",
              "description": "Itinerary category.",
              "enum": [
                "flight",
                "lodging",
                "activity"
              ]
            },
            "title": {
              "type": "string",
              "description": "Nonempty itinerary item title.",
              "minLength": 1
            },
            "date": {
              "type": "string",
              "description": "Itinerary date, destination-local YYYY-MM-DD; within inclusive trip dates.",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "time": {
              "type": "string",
              "description": "Destination-local HH:MM; omitted or empty means no time.",
              "pattern": "^(|([01]\\d|2[0-3]):[0-5]\\d)$"
            },
            "location": {
              "type": "string",
              "description": "Place or address; omitted or empty means none."
            },
            "confirmation_code": {
              "type": "string",
              "description": "Booking reference; omitted or empty means none."
            }
          },
          "required": [
            "trip_id",
            "kind",
            "title",
            "date"
          ],
          "additionalProperties": false
        }
      },
      "add-packing-item": {
        "description": "Add an unchecked packing item to an existing trip.",
        "schema": {
          "type": "object",
          "properties": {
            "trip_id": {
              "type": "string",
              "description": "Trip UUID.",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "description": "Packing item name.",
              "minLength": 1
            },
            "quantity": {
              "type": "integer",
              "description": "Positive number of pieces; omitted defaults to 1.",
              "minimum": 1,
              "maximum": 999
            }
          },
          "required": [
            "trip_id",
            "label"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "source": {
    "assets": [
      "index.html",
      "app.js",
      "app.css",
      "ui.css",
      "emits.js",
      "listens.js"
    ]
  }
}