mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
feat(tours): find bakeries and groceries on the map and along a hike
A multi-day hike restocks on the way: bread in the morning, food for lunch and supper every day or two. Neither could be searched for. - Explore pill: new `bakery` and `supermarket` chips. `supermarket` already existed on the server (shop=supermarket|convenience) but no pill offered it; `bakery` is new (shop=bakery). - Along the tour: `bakery` and `supermarket` are offered to a hike, after its existing kinds so a new hike still starts on the same three. - TREK places index: `bakery` maps to food_and_drink>casual_eatery>bakery; `supermarket` is narrowed to grocery and convenience stores, since the whole food_and_beverage_store branch also brought tobacconists and wine shops. Both paths checked against a live answer of the index. As the more specific term, a bakery is no longer listed as a place to eat when only `food` is asked along a tour. - Category guess: a bakery or grocer picked from the map was preselected as Bar/Cafe or Shopping even where the admin had made a Bakery or Groceries category. The guess now looks for such a category first, by name in the usual languages or by icon, and keeps the broad one when there is none. The category icon picker offers Croissant and ShoppingBasket, the icons the map chips use. - Labels in every locale; MCP tool description names the new kinds.
This commit is contained in:
committed by
Maurice
parent
8023be452a
commit
ec78cfbdd0
@@ -374,7 +374,9 @@ export const CATEGORY_OSM_FILTERS: Record<string, string[]> = {
|
||||
nature: ['leisure=park', 'leisure=garden', 'natural=beach', 'natural=peak'],
|
||||
activity: ['tourism=theme_park', 'tourism=zoo', 'tourism=aquarium', 'leisure=water_park'],
|
||||
shopping: ['shop=mall', 'shop=department_store', 'amenity=marketplace'],
|
||||
// A village shop or an épicerie stands in for a supermarket when shopping on the way.
|
||||
supermarket: ['shop=supermarket', 'shop=convenience'],
|
||||
bakery: ['shop=bakery'],
|
||||
// What a drive needs rather than what a city visit does (#1797). Separate from
|
||||
// `activity`/`nature` on purpose: nobody browsing museums wants petrol stations in
|
||||
// the same result set, and the road trip panel asks for these by name.
|
||||
|
||||
@@ -442,7 +442,10 @@ export const POI_CATEGORY_TO_TREK: Record<string, string[]> = {
|
||||
'sports_and_recreation>park>water_park',
|
||||
],
|
||||
shopping: ['shopping'],
|
||||
supermarket: ['shopping>food_and_beverage_store', 'shopping>convenience_store'],
|
||||
// The grocers alone: the whole food and beverage branch brought tobacconists and wine shops too.
|
||||
supermarket: ['shopping>food_and_beverage_store>grocery_store', 'shopping>convenience_store'],
|
||||
// Overture files a bakery under the casual eateries, beside the cafe.
|
||||
bakery: ['food_and_drink>casual_eatery>bakery'],
|
||||
// What a drive needs rather than what a city visit does (#1797). The corridor
|
||||
// search asks for these by name, and without them every corridor query fell
|
||||
// through to Overpass — the one path where that hurts most, because a single
|
||||
|
||||
@@ -41,6 +41,9 @@ const MAPS_CATEGORIES: Record<TourPoiCategory, readonly string[]> = {
|
||||
market: ['market'],
|
||||
// BIK-07: only points tagged for bicycles; the explore pill's `charging` is for cars.
|
||||
ebike_charging: ['ebike_charging'],
|
||||
// Resupply on a multi-day hike: the bread for the day, and food for lunch and supper.
|
||||
bakery: ['bakery'],
|
||||
supermarket: ['supermarket'],
|
||||
};
|
||||
|
||||
/** The most places of one kind the map search answers from each source. */
|
||||
|
||||
@@ -352,7 +352,7 @@ export class ToursMcp {
|
||||
@Tool({
|
||||
name: 'search_tour_pois',
|
||||
description:
|
||||
'Search places along the saved line of a tour: what a hike, a run, a ride, a bike tour, a paddle tour, a ski and winter tour or a city walk stops for (viewpoint, peak, shelter, drinking_water, food, toilets, picnic, campsite, sights, slipway, boat_rental, bike_repair for repair stations and bike shops, ebike_charging for the charging points of a bike tour, for a ski and winter tour cafe and restaurant as well, and for a city walk museum for museums and galleries, park for parks and gardens, cafe, restaurant and market), within corridor_m metres of the line. Answers each place with its source (TREK places index or OpenStreetMap), kind, address, website and phone where known, opening hours as the source has them (a hint to check, never a promise), distance_m (straight across to the line, not a detour) and along_m (from the start along the line); up to 60, the nearest to the line when more match, listed from the start. An ebike_charging place is one OpenStreetMap tags for bicycles (bicycle=designated or yes; a charger for cars alone never comes back) and carries charging: bicycle, sockets (type, count, kw), capacity, fee and access as OpenStreetMap states them, null or empty where it says nothing; whether it works or is free today is not known. When sights are asked for, the best known places near the line (by the page views of their Wikidata item) are searched too: a square or landmark no category names is added as a sight, and the highlights among them carry highlight: true and come first, the best known first. A place OpenStreetMap has no name for (a tap, a bench) comes with an empty name. unavailable lists the categories no source could be searched for right now: their places are missing, not absent, so ask again later rather than reporting none; retry_after_s, when present, is how many seconds until asking again makes sense, because the OpenStreetMap mirrors failed and are only probed now and then. partial says some stretches could not be searched, capped that only the first part of a long line was, truncated that more places matched. A tour saved with its points only (route_pending) has no line to search along yet. Nothing is added to the tour or the trip.',
|
||||
'Search places along the saved line of a tour: what a hike, a run, a ride, a bike tour, a paddle tour, a ski and winter tour or a city walk stops for (viewpoint, peak, shelter, drinking_water, food, toilets, picnic, campsite, sights, slipway, boat_rental, bike_repair for repair stations and bike shops, ebike_charging for the charging points of a bike tour, for a hike bakery and supermarket (supermarkets and village shops) to restock on the way, for a ski and winter tour cafe and restaurant as well, and for a city walk museum for museums and galleries, park for parks and gardens, cafe, restaurant and market), within corridor_m metres of the line. Answers each place with its source (TREK places index or OpenStreetMap), kind, address, website and phone where known, opening hours as the source has them (a hint to check, never a promise), distance_m (straight across to the line, not a detour) and along_m (from the start along the line); up to 60, the nearest to the line when more match, listed from the start. An ebike_charging place is one OpenStreetMap tags for bicycles (bicycle=designated or yes; a charger for cars alone never comes back) and carries charging: bicycle, sockets (type, count, kw), capacity, fee and access as OpenStreetMap states them, null or empty where it says nothing; whether it works or is free today is not known. When sights are asked for, the best known places near the line (by the page views of their Wikidata item) are searched too: a square or landmark no category names is added as a sight, and the highlights among them carry highlight: true and come first, the best known first. A place OpenStreetMap has no name for (a tap, a bench) comes with an empty name. unavailable lists the categories no source could be searched for right now: their places are missing, not absent, so ask again later rather than reporting none; retry_after_s, when present, is how many seconds until asking again makes sense, because the OpenStreetMap mirrors failed and are only probed now and then. partial says some stretches could not be searched, capped that only the first part of a long line was, truncated that more places matched. A tour saved with its points only (route_pending) has no line to search along yet. Nothing is added to the tour or the trip.',
|
||||
inputSchema: {
|
||||
tripId: idSchema,
|
||||
placeId: idSchema.describe('The place id of the tour, as list_tours gives it'),
|
||||
|
||||
Reference in New Issue
Block a user