@curless/hotel-storefront 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/tools/all-tools.d.ts +17954 -172
- package/dist/tools/all-tools.d.ts.map +1 -1
- package/dist/tools/all-tools.js +38 -949
- package/dist/tools/all-tools.js.map +1 -1
- package/dist/tools/base-output-schemas.d.ts.map +1 -1
- package/dist/tools/base-output-schemas.js +17 -1
- package/dist/tools/base-output-schemas.js.map +1 -1
- package/dist/tools/booking-answer.d.ts.map +1 -1
- package/dist/tools/booking-answer.js +239 -157
- package/dist/tools/booking-answer.js.map +1 -1
- package/dist/tools/cancel.d.ts +1 -1
- package/dist/tools/cancel.d.ts.map +1 -1
- package/dist/tools/cancel.js +199 -148
- package/dist/tools/cancel.js.map +1 -1
- package/dist/tools/capability-adjust.d.ts +31 -0
- package/dist/tools/capability-adjust.d.ts.map +1 -0
- package/dist/tools/capability-adjust.js +299 -0
- package/dist/tools/capability-adjust.js.map +1 -0
- package/dist/tools/current-trip.d.ts.map +1 -1
- package/dist/tools/current-trip.js +40 -32
- package/dist/tools/current-trip.js.map +1 -1
- package/dist/tools/get-hotel.d.ts +1 -1
- package/dist/tools/get-hotel.d.ts.map +1 -1
- package/dist/tools/get-hotel.js +151 -125
- package/dist/tools/get-hotel.js.map +1 -1
- package/dist/tools/hotel-choices.d.ts.map +1 -1
- package/dist/tools/hotel-choices.js +111 -82
- package/dist/tools/hotel-choices.js.map +1 -1
- package/dist/tools/itinerary.d.ts +1 -1
- package/dist/tools/itinerary.d.ts.map +1 -1
- package/dist/tools/itinerary.js +46 -36
- package/dist/tools/itinerary.js.map +1 -1
- package/dist/tools/list-hotels-ask.d.ts +133 -0
- package/dist/tools/list-hotels-ask.d.ts.map +1 -0
- package/dist/tools/list-hotels-ask.js +326 -0
- package/dist/tools/list-hotels-ask.js.map +1 -0
- package/dist/tools/list-hotels-empty.d.ts +5 -0
- package/dist/tools/list-hotels-empty.d.ts.map +1 -0
- package/dist/tools/list-hotels-empty.js +130 -0
- package/dist/tools/list-hotels-empty.js.map +1 -0
- package/dist/tools/list-hotels-home.d.ts +9 -0
- package/dist/tools/list-hotels-home.d.ts.map +1 -0
- package/dist/tools/list-hotels-home.js +181 -0
- package/dist/tools/list-hotels-home.js.map +1 -0
- package/dist/tools/list-hotels-page.d.ts +43 -0
- package/dist/tools/list-hotels-page.d.ts.map +1 -0
- package/dist/tools/list-hotels-page.js +344 -0
- package/dist/tools/list-hotels-page.js.map +1 -0
- package/dist/tools/list-hotels.d.ts +1 -1
- package/dist/tools/list-hotels.d.ts.map +1 -1
- package/dist/tools/list-hotels.js +22 -889
- package/dist/tools/list-hotels.js.map +1 -1
- package/dist/tools/look-up.d.ts +1 -1
- package/dist/tools/look-up.d.ts.map +1 -1
- package/dist/tools/look-up.js +70 -33
- package/dist/tools/look-up.js.map +1 -1
- package/dist/tools/put-room-line.d.ts.map +1 -1
- package/dist/tools/put-room-line.js +248 -215
- package/dist/tools/put-room-line.js.map +1 -1
- package/dist/tools/room-choices.d.ts.map +1 -1
- package/dist/tools/room-choices.js +74 -48
- package/dist/tools/room-choices.js.map +1 -1
- package/dist/tools/terms-answer.d.ts.map +1 -1
- package/dist/tools/terms-answer.js +48 -31
- package/dist/tools/terms-answer.js.map +1 -1
- package/dist/tools/tool-defs-account.d.ts +80 -0
- package/dist/tools/tool-defs-account.d.ts.map +1 -0
- package/dist/tools/tool-defs-account.js +65 -0
- package/dist/tools/tool-defs-account.js.map +1 -0
- package/dist/tools/tool-defs-addons.d.ts +251 -0
- package/dist/tools/tool-defs-addons.d.ts.map +1 -0
- package/dist/tools/tool-defs-addons.js +198 -0
- package/dist/tools/tool-defs-addons.js.map +1 -0
- package/dist/tools/tool-defs-booking.d.ts +410 -0
- package/dist/tools/tool-defs-booking.d.ts.map +1 -0
- package/dist/tools/tool-defs-booking.js +285 -0
- package/dist/tools/tool-defs-booking.js.map +1 -0
- package/dist/tools/tool-defs-browse.d.ts +444 -0
- package/dist/tools/tool-defs-browse.d.ts.map +1 -0
- package/dist/tools/tool-defs-browse.js +307 -0
- package/dist/tools/tool-defs-browse.js.map +1 -0
- package/dist/tools/tool-defs-trip.d.ts +136 -0
- package/dist/tools/tool-defs-trip.d.ts.map +1 -0
- package/dist/tools/tool-defs-trip.js +79 -0
- package/dist/tools/tool-defs-trip.js.map +1 -0
- package/dist/tools/tool-env.d.ts +64 -0
- package/dist/tools/tool-env.d.ts.map +1 -0
- package/dist/tools/tool-env.js +49 -0
- package/dist/tools/tool-env.js.map +1 -0
- package/dist/tools/tool-set.d.ts +698 -747
- package/dist/tools/tool-set.d.ts.map +1 -1
- package/dist/tools/tool-set.js +14 -267
- package/dist/tools/tool-set.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { MAX_PAGE } from '../backend.js';
|
|
2
|
+
import { MAX_ROOMS_PER_LINE } from '../trip.js';
|
|
3
|
+
import { asStay, groupNamed, place, str } from './args.js';
|
|
4
|
+
import { CITY_PICKER_MIN, HOME_LIST_MAX, filtersOf } from './current-trip.js';
|
|
5
|
+
import { SORTS, everyCityOf, groupNameOf, sentence, widen, } from './request-words.js';
|
|
6
|
+
import { degradedOf, identity } from './session-notes.js';
|
|
7
|
+
import { TONIGHT_PAGE_MAX } from './tool-set.js';
|
|
8
|
+
/** The search the call asks for, and who asks. */
|
|
9
|
+
export const askedOf = ({ deps, args, ctx, t, key }) => {
|
|
10
|
+
// ⚠️ A TRIP TO PLAN IS NOT MORE BROWSING (robin's own claude.ai, live 0.47.7,
|
|
11
|
+
// read by 总线程 2026-10-26): 「打开亚朵」 drew this list - right - and then
|
|
12
|
+
// 「11月1号到7号北京行程」 carried on from it: a look-up and a table of four
|
|
13
|
+
// hotels' prices, or this list again for Beijing, and no day planned. The
|
|
14
|
+
// server instructions say otherwise, but a host may not pass them on; this
|
|
15
|
+
// answer always reaches the model, so it says it here, after the list.
|
|
16
|
+
const forPlans = `A stay of several days with its days to plan (行程, an itinerary) is laid out day by day with ${t.itinerary}, its ${deps.vocab.nounPlural} read up with ${t.lookUp} near where each part of the trip is spent - also right after this list; this list is for a guest looking through ${deps.vocab.nounPlural}.`;
|
|
17
|
+
const query = place(args.query);
|
|
18
|
+
const city = place(args.city);
|
|
19
|
+
const sort = SORTS.includes(str(args.sort))
|
|
20
|
+
? str(args.sort)
|
|
21
|
+
: 'group';
|
|
22
|
+
const ceiling = Number(args.maxNightly) > 0 ? Number(args.maxNightly) : undefined;
|
|
23
|
+
const ask = {
|
|
24
|
+
query: query || undefined,
|
|
25
|
+
city: city || undefined,
|
|
26
|
+
limit: typeof args.limit === 'number' ? args.limit : undefined,
|
|
27
|
+
offset: Number(args.offset) > 0 ? Math.floor(Number(args.offset)) : undefined,
|
|
28
|
+
sort,
|
|
29
|
+
maxNightly: ceiling,
|
|
30
|
+
stay: asStay(args),
|
|
31
|
+
// Clamped here, so what is said and echoed is what was priced: "9 rooms"
|
|
32
|
+
// was said over prices for five.
|
|
33
|
+
rooms: typeof args.rooms === 'number' && Number.isFinite(args.rooms)
|
|
34
|
+
? Math.max(1, Math.min(MAX_ROOMS_PER_LINE, Math.floor(args.rooms)))
|
|
35
|
+
: undefined,
|
|
36
|
+
filters: filtersOf(args),
|
|
37
|
+
// Tonight by default: the page alone is priced (`listsTonight`, below).
|
|
38
|
+
...(ctx.pricePageOnly ? { pricePageOnly: true } : {}),
|
|
39
|
+
};
|
|
40
|
+
// A group as a guest names it, to the id the market files it under.
|
|
41
|
+
const named = ask.filters?.supplier ? groupNamed(deps, ask.filters.supplier) : undefined;
|
|
42
|
+
if (ask.filters?.supplier && named)
|
|
43
|
+
ask.filters = { ...ask.filters, supplier: named.id };
|
|
44
|
+
const who = identity(deps, ctx, key, args);
|
|
45
|
+
return { ask, query, city, sort, ceiling, who, forPlans };
|
|
46
|
+
};
|
|
47
|
+
// ⚠️ A FILTER OR A CEILING THAT EMPTIED THE LIST IS NOT A SEARCH THAT
|
|
48
|
+
// FAILED either, for the same reason as the ceiling (`searchWithWidening`, below): the place
|
|
49
|
+
// matched. What matched the place and the words, before either:
|
|
50
|
+
export const placedCount = (a) => a.beforeFilters ?? a.beforeCeiling ?? a.total;
|
|
51
|
+
/** The search asked of the backend, and - when it came to nothing - once more, wider. */
|
|
52
|
+
export const searchWithWidening = async ({ deps }, { ask, who }) => {
|
|
53
|
+
// ⚠️ A MARKET'S CITY FIELD, ASKED BESIDE THE SEARCH (0.68.0): a narrowed list's menu is
|
|
54
|
+
// every city, so the market is asked once more with nothing - at the same time, not
|
|
55
|
+
// after: a group that hangs would otherwise be waited for twice. Kept a minute whatever
|
|
56
|
+
// came back, and asked as no guest's (`everyCityOf`). One that fails is no menu.
|
|
57
|
+
const narrowedAsk = !!(ask.query || ask.city || ask.filters || ask.maxNightly);
|
|
58
|
+
const marketCities = narrowedAsk && (deps.backend.suppliers || deps.vocab.market) ? everyCityOf(deps) : undefined;
|
|
59
|
+
let answer = await deps.backend.searchHotels(ask, who);
|
|
60
|
+
// A brand as the data spells it, so its chip shows as ON and can be turned
|
|
61
|
+
// off: `brand: 'kerry'` filtered, and then no chip matched it.
|
|
62
|
+
const brandAsked = ask.filters?.brand?.toLowerCase();
|
|
63
|
+
const brandNamed = answer.refine?.brands.find((b) => b.name.toLowerCase() === brandAsked)?.name;
|
|
64
|
+
if (ask.filters && brandNamed)
|
|
65
|
+
ask.filters = { ...ask.filters, brand: brandNamed };
|
|
66
|
+
// The search the answer actually came from - the widened one, when it was
|
|
67
|
+
// widened - so its next page is the next page of THAT.
|
|
68
|
+
let asked = ask;
|
|
69
|
+
// ⚠️ ONE WIDER SEARCH BEFORE THE WORD "NO". A group with ninety-six
|
|
70
|
+
// properties and a guest who typed "Shangri La Tokyo" into `city` gets
|
|
71
|
+
// nothing, and "no hotels match that" is a lie about a group with two in
|
|
72
|
+
// Tokyo. One retry, named in the answer so nobody presents a widening as a
|
|
73
|
+
// match - and only ONE, because a search that keeps loosening until it
|
|
74
|
+
// finds something will always find something.
|
|
75
|
+
//
|
|
76
|
+
// ⚠️ AND IT ONLY WIDENS THE PLACE AND THE WORDS. A `maxNightly` that
|
|
77
|
+
// excluded everything is not a failed search: the place matched, the words
|
|
78
|
+
// matched, and the prices were the answer. Widening there dropped "Hong
|
|
79
|
+
// Kong" and came back with five hotels in two countries, ceiling silently
|
|
80
|
+
// unapplied because the wider set no longer shared a currency (found by
|
|
81
|
+
// reading the output, 2026-09-22) - which is the runaway loosening this
|
|
82
|
+
// comment was written to forbid, committed by the code under it.
|
|
83
|
+
// `overBudget` is how the seam says the place and the words did match.
|
|
84
|
+
let widened;
|
|
85
|
+
// ⚠️ AND NOT WHEN A GROUP DID NOT ANSWER (2026-11-03 review, C4). The place
|
|
86
|
+
// "matched nothing" among the groups that answered; the one that did not
|
|
87
|
+
// may have it. A wider search then found something else, took over as the
|
|
88
|
+
// answer, and the first search's "X did not answer" went with it - "nothing
|
|
89
|
+
// matched Hong Kong, so this is Shenzhen", with Hong Kong's group silent.
|
|
90
|
+
// It also cost another time limit. The empty answer is given as it is, with
|
|
91
|
+
// the sentence that the group did not answer (`degradedOf`).
|
|
92
|
+
if (placedCount(answer) === 0 && !answer.degraded?.length) {
|
|
93
|
+
const wider = widen(ask);
|
|
94
|
+
if (wider) {
|
|
95
|
+
const second = await deps.backend.searchHotels(wider.ask, who);
|
|
96
|
+
// Found when the wider PLACE matched - a wider search emptied by the
|
|
97
|
+
// same ceiling or filter is still the place, and "Hong Kong found
|
|
98
|
+
// nothing either" was said of four hotels over the ceiling.
|
|
99
|
+
const { ask: _wider, ...said } = wider;
|
|
100
|
+
widened = { ...said, found: placedCount(second) > 0 };
|
|
101
|
+
if (widened.found) {
|
|
102
|
+
answer = second;
|
|
103
|
+
asked = { ...ask, ...wider.ask };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { answer, asked, widened, marketCities };
|
|
108
|
+
};
|
|
109
|
+
/** The page of hotels the backend answered, and the places it can be narrowed to. */
|
|
110
|
+
export const pageOf = ({ deps }, { answer, asked }) => {
|
|
111
|
+
const filteredEmpty = !!asked.filters &&
|
|
112
|
+
answer.total === 0 &&
|
|
113
|
+
placedCount(answer) > 0 &&
|
|
114
|
+
(answer.beforeCeiling ?? 0) === 0;
|
|
115
|
+
const ceilingEmpty = answer.total === 0 && (answer.beforeCeiling ?? 0) > 0;
|
|
116
|
+
// The ceiling again on this side of the seam. MAX_PAGE is part of the
|
|
117
|
+
// backend contract, but "the next backend honours it" is not something the
|
|
118
|
+
// card can be built on - and the cost of it being wrong is the whole group
|
|
119
|
+
// in the model's context.
|
|
120
|
+
// ⚠️ A HOTEL NOT ON SALE HERE SAYS WHERE IT IS (review r2, T5): its page said
|
|
121
|
+
// the group's own channels, its tile on a list - the answer a model often
|
|
122
|
+
// stops at - only that nothing was on sale. In the text and the structure.
|
|
123
|
+
const hotels = answer.hotels.slice(0, MAX_PAGE).map((h) => h.noRoomsForStayCode === 'none-on-sale' && h.noRoomsForStay
|
|
124
|
+
? {
|
|
125
|
+
...h,
|
|
126
|
+
noRoomsForStay: `${h.noRoomsForStay.replace(/[.\s]+$/, '')} - it can be booked through ${groupNameOf(deps, h.id)}'s own channels: its app, its website or by phone.`,
|
|
127
|
+
}
|
|
128
|
+
: h);
|
|
129
|
+
const offset = asked.offset ?? 0;
|
|
130
|
+
const total = Math.max(answer.total, offset + hotels.length);
|
|
131
|
+
// One city however its group writes it (0.74.5: Accor's "SINGAPORE" beside "Singapore").
|
|
132
|
+
const cities = [
|
|
133
|
+
...hotels
|
|
134
|
+
.reduce((m, h) => {
|
|
135
|
+
const k = h.city.trim().toLowerCase();
|
|
136
|
+
if (!m.has(k))
|
|
137
|
+
m.set(k, h.city);
|
|
138
|
+
return m;
|
|
139
|
+
}, new Map())
|
|
140
|
+
.values(),
|
|
141
|
+
];
|
|
142
|
+
// How many were left behind. The group has ninety-odd properties, so an
|
|
143
|
+
// unnarrowed browse is a page of a much longer list, and neither the card
|
|
144
|
+
// nor the model may present the page as the whole answer.
|
|
145
|
+
const more = Math.max(0, total - offset - hotels.length);
|
|
146
|
+
// ⚠️ THE WAYS IN, COUNTED ACROSS EVERYTHING THAT MATCHED. "Showing 20 of 96
|
|
147
|
+
// - name a city" left a guest to type a place they could not see (robin,
|
|
148
|
+
// 2026-09-28: 「是否要加一个城市筛选之类的功能,然后可以选择查看更多」). An
|
|
149
|
+
// unnarrowed browse offers the countries; a country with several cities
|
|
150
|
+
// offers its cities; one city offers nothing, because it is already there.
|
|
151
|
+
const facets = answer.facets;
|
|
152
|
+
const narrowedTo = asked.city?.toLowerCase();
|
|
153
|
+
// A place as a chip: its own name is what it is asked by again, and its
|
|
154
|
+
// names - or its country's code - what the card says it in (robin, 2026-10-15).
|
|
155
|
+
const cityPlace = (c) => ({
|
|
156
|
+
label: c.name,
|
|
157
|
+
place: c.name,
|
|
158
|
+
count: c.count,
|
|
159
|
+
...(c.names ? { names: c.names } : {}),
|
|
160
|
+
});
|
|
161
|
+
const countryPlace = (c) => ({
|
|
162
|
+
label: c.name,
|
|
163
|
+
place: c.name,
|
|
164
|
+
count: c.count,
|
|
165
|
+
...(c.code ? { code: c.code } : {}),
|
|
166
|
+
});
|
|
167
|
+
const places = !facets
|
|
168
|
+
? []
|
|
169
|
+
: asked.query
|
|
170
|
+
? facets.cities.length > 1
|
|
171
|
+
? facets.cities.map(cityPlace)
|
|
172
|
+
: []
|
|
173
|
+
: !narrowedTo
|
|
174
|
+
? facets.countries.length > 1
|
|
175
|
+
? facets.countries.map(countryPlace)
|
|
176
|
+
: []
|
|
177
|
+
: facets.cities.length > 1
|
|
178
|
+
? facets.cities.map(cityPlace)
|
|
179
|
+
: [];
|
|
180
|
+
return { filteredEmpty, ceilingEmpty, hotels, offset, total, cities, more, facets, places };
|
|
181
|
+
};
|
|
182
|
+
/** What kind of list this is: the search echoed, whether it fits one page, whether it is a place to choose. */
|
|
183
|
+
export const searchShape = ({ deps, args }, { ask, sort }, { answer, asked, widened }, { hotels, offset, total, facets }) => {
|
|
184
|
+
// ⚠️ THE MISSES ARE THE ANSWER when a ceiling is what emptied the list. A
|
|
185
|
+
// guest asking for under HK$1,000 learns nothing from "no hotels"; told the
|
|
186
|
+
// cheapest is HK$1,180 they can decide. They are named as misses and kept
|
|
187
|
+
// out of `hotels`, so no card and no model can show them as matches.
|
|
188
|
+
// ⚠️ SOMEWHERE FIRST, THEN A HOTEL (robin, 2026-09-28: 「和温德姆一样,先让人
|
|
189
|
+
// 选国家和城市,然后再选酒店」). An unnarrowed browse used to be twenty tiles
|
|
190
|
+
// of ninety-six under a row of country chips; a country of forty cities
|
|
191
|
+
// was the same. Neither is a choice a guest can make. Where nothing - or
|
|
192
|
+
// only a country with many cities - was named, the answer is the PLACES:
|
|
193
|
+
// regions, countries and cities, each with how many there are, and a city
|
|
194
|
+
// is the way to its hotels. `all` still lists the hotels themselves.
|
|
195
|
+
// The nights and rooms, as a search asks for them again: kept on a place,
|
|
196
|
+
// a sort, a next page.
|
|
197
|
+
const stayArgs = ask.stay
|
|
198
|
+
? {
|
|
199
|
+
checkIn: ask.stay.checkIn,
|
|
200
|
+
checkOut: ask.stay.checkOut,
|
|
201
|
+
guests: ask.stay.guests,
|
|
202
|
+
...(ask.rooms && ask.rooms > 1 ? { rooms: ask.rooms } : {}),
|
|
203
|
+
}
|
|
204
|
+
: {};
|
|
205
|
+
// How many the whole deployment has: the server says, and an unnarrowed
|
|
206
|
+
// answer is it. A deployment of up to HOME_LIST_MAX fits on one page -
|
|
207
|
+
// never a market, whose home is its groups.
|
|
208
|
+
const unnarrowed = !ask.query && !ask.city && !ask.filters && !ask.maxNightly;
|
|
209
|
+
const deployed = deps.hotelCount?.() ?? (unnarrowed ? answer.total : 0);
|
|
210
|
+
// ⚠️ A BACKEND THAT HAS NO PRICE FOR A STAY (11-05; Otaless, whose /rooms is empty
|
|
211
|
+
// and whose from-price says nothing of taxes - `Hotel.fromNightlyTaxes`) lists a
|
|
212
|
+
// from-price a night and no stay total, with dates or without. The list must not
|
|
213
|
+
// promise one ("priced for the nights you choose", "each price is for the whole
|
|
214
|
+
// stay"); it says what the price is. The card reads the same flag.
|
|
215
|
+
const fromPricesOnly = hotels.length > 0 &&
|
|
216
|
+
hotels.every((h) => h.fromNightly && h.fromNightlyTaxes === 'unknown' && !h.forStay && !h.noRoomsForStay);
|
|
217
|
+
const fitsOnePage = !deps.backend.suppliers && !deps.vocab.market && deployed >= 1 && deployed <= HOME_LIST_MAX;
|
|
218
|
+
// ⚠️ THE SEARCH AS ASKED, `all` INCLUDED. The echo dropped `all`, so every
|
|
219
|
+
// re-query the card made from a "Browse all" list - new dates, the default
|
|
220
|
+
// order, clearing a filter - met no place, no words and no filter, and
|
|
221
|
+
// came back as the destinations page (2026-09-28 audit). Built once, for
|
|
222
|
+
// the list and for the list a filter or a ceiling emptied.
|
|
223
|
+
//
|
|
224
|
+
// ⚠️ WHERE IT ALL FITS ON ONE PAGE, `all` IS THE HOME (robin, 2026-10-30:
|
|
225
|
+
// 「华住默认还是没有日期呀」). Huazhu's production has two; asked to open
|
|
226
|
+
// Huazhu, the model sent `all: true` - "lists the hotels themselves" - and
|
|
227
|
+
// that skipped the home: no tonight, no prices, "All hotels · add dates".
|
|
228
|
+
// Here every hotel is on the home already, so `all` asks for nothing more.
|
|
229
|
+
const listAll = args.all === true && !fitsOnePage;
|
|
230
|
+
const echo = (applied) => ({
|
|
231
|
+
...(asked.query ? { query: asked.query } : {}),
|
|
232
|
+
...(asked.city ? { city: asked.city } : {}),
|
|
233
|
+
...(applied !== 'group' ? { sort: applied } : {}),
|
|
234
|
+
...(asked.maxNightly ? { maxNightly: asked.maxNightly } : {}),
|
|
235
|
+
...(asked.filters ?? {}),
|
|
236
|
+
...(listAll ? { all: true } : {}),
|
|
237
|
+
...stayArgs,
|
|
238
|
+
});
|
|
239
|
+
// A country, said as the data spells it - or by another name the backend
|
|
240
|
+
// understood (中国, from a place's aliases or a market's): the answer is
|
|
241
|
+
// one country and many cities, none of them the place asked for. "中国"
|
|
242
|
+
// drew fifty hotels where "China" drew the city picker (Marketplace,
|
|
243
|
+
// 2026-10-08).
|
|
244
|
+
const namedCountry = !!asked.city &&
|
|
245
|
+
facets?.countries.length === 1 &&
|
|
246
|
+
(facets.countries[0]?.name.toLowerCase() === asked.city.toLowerCase() ||
|
|
247
|
+
(facets.cities.length > 1 &&
|
|
248
|
+
!facets.cities.some((c) => c.name.toLowerCase() === asked.city?.toLowerCase())));
|
|
249
|
+
const choosing = facets &&
|
|
250
|
+
!asked.filters &&
|
|
251
|
+
!asked.query &&
|
|
252
|
+
sort === 'group' &&
|
|
253
|
+
!asked.maxNightly &&
|
|
254
|
+
!offset &&
|
|
255
|
+
!listAll &&
|
|
256
|
+
// A widened search is a list with the miss said over it: as a page of
|
|
257
|
+
// places, "helipad" matching nothing in China was never said at all.
|
|
258
|
+
!widened &&
|
|
259
|
+
(!asked.city || (namedCountry && facets.cities.length >= CITY_PICKER_MIN));
|
|
260
|
+
return {
|
|
261
|
+
stayArgs,
|
|
262
|
+
unnarrowed,
|
|
263
|
+
deployed,
|
|
264
|
+
fromPricesOnly,
|
|
265
|
+
fitsOnePage,
|
|
266
|
+
listAll,
|
|
267
|
+
echo,
|
|
268
|
+
namedCountry,
|
|
269
|
+
choosing,
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
/** The date where the hotels are, and whether a list is priced for tonight or is the home. */
|
|
273
|
+
export const tonightShape = ({ deps }, { answer, asked, total, hotels, choosing, fitsOnePage }) => {
|
|
274
|
+
// "Today" where the hotels are - earliest and latest - for a page that has
|
|
275
|
+
// no one hotel's clock to fill its date bar from (see the card's
|
|
276
|
+
// `todayRange`): the UTC date was yesterday in Asia before 8am.
|
|
277
|
+
const days = answer.hotels
|
|
278
|
+
.map((h) => h.todayThere)
|
|
279
|
+
.filter((x) => !!x)
|
|
280
|
+
.sort();
|
|
281
|
+
const today = days.length ? { min: days[0], max: days.at(-1) } : undefined;
|
|
282
|
+
// ⚠️ THE HOME OF A FEW OPENS ON TONIGHT, PRICED (robin, 2026-10-30: 「我刚刚
|
|
283
|
+
// 打开华住,没自动选日期」 - of three ways, he chose 「默认今晚并直接出价」).
|
|
284
|
+
// 0.50.3 left the dates empty because dates over prices that were not
|
|
285
|
+
// theirs read as that night's prices; here the dates and the prices are
|
|
286
|
+
// the same night, so that cannot happen. Tonight is the hotels' own date
|
|
287
|
+
// (the earliest of them, `todayThere`), for the default party; asked again
|
|
288
|
+
// with those nights, the answer is the home as before - priced.
|
|
289
|
+
//
|
|
290
|
+
// ⚠️ AND EVERY LIST THERE WITHOUT DATES, NOT THE HOME ALONE (0.51.1). In a
|
|
291
|
+
// deployment that fits on one page a list - a city, words, a filter, `all`
|
|
292
|
+
// - is the home or a part of it: without dates it was the same hotels with
|
|
293
|
+
// tonight's prices taken away, "add dates to see what a stay costs" one
|
|
294
|
+
// turn after the home showed them. It costs what the home costs, a quote
|
|
295
|
+
// per hotel (six at most). A group of many still chooses a city first and
|
|
296
|
+
// lists twenty at a time without prices, a market its group; rooms by the
|
|
297
|
+
// hour are today's by their own rule; dates the model gave are used as given.
|
|
298
|
+
//
|
|
299
|
+
// ⚠️ AND IN A DEPLOYMENT PRICED FOR TONIGHT, AT ANY SIZE (`listsTonight`, 0.75.1 -
|
|
300
|
+
// robin 11-18 at Huazhu's 88: 「怎么变成要选日期了,不是默认当天的吗」). Its home is still
|
|
301
|
+
// the cities to choose from, unpriced (`choosing`); every list - a city, words, a brand,
|
|
302
|
+
// a filter, `all` - is tonight's, priced: this page only, at most TONIGHT_PAGE_MAX,
|
|
303
|
+
// through the group's own limit on calls and its minute of kept prices. A hotel whose
|
|
304
|
+
// price cannot be read is listed without one, said as that (`noRoomsForStayCode`
|
|
305
|
+
// 'unreachable'); a list that cannot be priced at all is the list as it was.
|
|
306
|
+
const tonightLists = !fitsOnePage &&
|
|
307
|
+
!choosing &&
|
|
308
|
+
deps.backend.capabilities?.listsTonight === true &&
|
|
309
|
+
!deps.backend.suppliers &&
|
|
310
|
+
!deps.vocab.market;
|
|
311
|
+
// ⚠️ A FEW HOTELS ARE NO CHOICE OF PLACES EITHER (robin, 2026-10-30):
|
|
312
|
+
// Huazhu's production had two, in two cities, and its home was "where to?"
|
|
313
|
+
// over two city chips and "browse all 2" - the model then listed them
|
|
314
|
+
// again, a second card for the same question. Where the whole deployment
|
|
315
|
+
// fits on one page - never a market, whose home is its groups - the home
|
|
316
|
+
// is the list of all of them, marked `home` so the card keeps the home's
|
|
317
|
+
// own ways in on it.
|
|
318
|
+
const homeList = !!choosing &&
|
|
319
|
+
!asked.city &&
|
|
320
|
+
!deps.backend.suppliers &&
|
|
321
|
+
total > 1 &&
|
|
322
|
+
total <= HOME_LIST_MAX &&
|
|
323
|
+
hotels.length === total;
|
|
324
|
+
return { today, tonightLists, homeList };
|
|
325
|
+
};
|
|
326
|
+
//# sourceMappingURL=list-hotels-ask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-hotels-ask.js","sourceRoot":"","sources":["../../src/tools/list-hotels-ask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACL,KAAK,EAEL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAejD,kDAAkD;AAClD,MAAM,CAAC,MAAM,OA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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,yEAAyE;IACzE,uDAAuD;IACvD,sEAAsE;IACtE,wEAAwE;IACxE,yEAAyE;IACzE,2EAA2E;IAC3E,gEAAgE;IAChE,EAAE;IACF,2EAA2E;IAC3E,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,8EAA8E;IAC9E,EAAE;IACF,mFAAmF;IACnF,uEAAuE;IACvE,yFAAyF;IACzF,oFAAoF;IACpF,sFAAsF;IACtF,iFAAiF;IACjF,6EAA6E;IAC7E,MAAM,YAAY,GAChB,CAAC,WAAW;QACZ,CAAC,QAAQ;QACT,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI;QAChD,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS;QACvB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IACrB,sEAAsE;IACtE,2EAA2E;IAC3E,sEAAsE;IACtE,yEAAyE;IACzE,yEAAyE;IACzE,yEAAyE;IACzE,qBAAqB;IACrB,MAAM,QAAQ,GACZ,CAAC,CAAC,QAAQ;QACV,CAAC,KAAK,CAAC,IAAI;QACX,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS;QACvB,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,aAAa;QACtB,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC;IAC1B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ToolAnswer } from './deps.js';
|
|
2
|
+
import type { ListCx } from './list-hotels-ask.js';
|
|
3
|
+
/** Nothing to list: why, and what is nearest. */
|
|
4
|
+
export declare const noHotelsAnswer: ({ deps, ctx, key, ask, query, city, sort, ceiling, answer, asked, widened, filteredEmpty, ceilingEmpty, hotels, offset, cities, echo, }: ListCx) => ToolAnswer;
|
|
5
|
+
//# sourceMappingURL=list-hotels-empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-hotels-empty.d.ts","sourceRoot":"","sources":["../../src/tools/list-hotels-empty.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAMnD,iDAAiD;AACjD,eAAO,MAAM,cAAc,GAAI,yIAkB5B,MAAM,KAAG,UAiIX,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { DESCRIPTION_MAX, hotelText } from '../fence.js';
|
|
2
|
+
import { formatMoney, money, toMinor } from '../money.js';
|
|
3
|
+
import { branded } from '../vocab.js';
|
|
4
|
+
import { place } from './args.js';
|
|
5
|
+
import { emptiedBy, refineFor } from './current-trip.js';
|
|
6
|
+
import { common } from './paid-lines.js';
|
|
7
|
+
import { withZh } from './quote-card.js';
|
|
8
|
+
import { sentence } from './request-words.js';
|
|
9
|
+
import { degradedOf, quietIn } from './session-notes.js';
|
|
10
|
+
/** Nothing to list: why, and what is nearest. */
|
|
11
|
+
export const noHotelsAnswer = ({ deps, ctx, key, ask, query, city, sort, ceiling, answer, asked, widened, filteredEmpty, ceilingEmpty, hotels, offset, cities, echo, }) => {
|
|
12
|
+
const nearest = (answer.nearest ?? []).map((h) => ({
|
|
13
|
+
...h,
|
|
14
|
+
summary: hotelText('description', h.name, h.summary, DESCRIPTION_MAX).text,
|
|
15
|
+
fromNightly: h.fromNightly ? formatMoney(h.fromNightly) : undefined,
|
|
16
|
+
...(h.forStay
|
|
17
|
+
? {
|
|
18
|
+
forStay: {
|
|
19
|
+
...h.forStay,
|
|
20
|
+
total: formatMoney(h.forStay.total),
|
|
21
|
+
nightly: formatMoney(h.forStay.nightly),
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
: {}),
|
|
25
|
+
}));
|
|
26
|
+
const [first] = answer.nearest ?? [];
|
|
27
|
+
// On named nights, a night of the stay that was priced - the list rate
|
|
28
|
+
// was quoted beside a ceiling it was never held against.
|
|
29
|
+
const cheapest = first?.forStay?.nightly ?? first?.fromNightly;
|
|
30
|
+
const capCurrency = answer.currencies[0] ?? cheapest?.currency ?? 'HKD';
|
|
31
|
+
const cap = formatMoney(money(toMinor(Number(ceiling), capCurrency), capCurrency));
|
|
32
|
+
const pastTheEnd = answer.total > 0 && offset > 0;
|
|
33
|
+
/** Empty for a reason of its own - a page past the end, the filters, the ceiling. */
|
|
34
|
+
const emptyOfItself = pastTheEnd || filteredEmpty || ceilingEmpty;
|
|
35
|
+
// ⚠️ SAID ONLY IF ASKED WHERE IT IS NOT WHY IT IS EMPTY (0.74.4): where nothing could be
|
|
36
|
+
// read at all, the groups that did not answer are the reason, and said.
|
|
37
|
+
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards, undefined, quietIn(deps, asked.filters?.supplier), emptyOfItself);
|
|
38
|
+
// ⚠️ NOTHING READ IS NOT "NOTHING MATCHES" (0.59.0, review U4): with every
|
|
39
|
+
// group silent - or held back by a limit of ours (otaless/limits.ts) - the
|
|
40
|
+
// answer said "No hotels match that" beside "did not answer in time", and
|
|
41
|
+
// the card offered another city. What was not asked, or not answered, is
|
|
42
|
+
// said as that; what our limit held back is said in its own words
|
|
43
|
+
// (`unapplied`), which this branch did not read.
|
|
44
|
+
// ⚠️ A GROUP LOOKED UP ONLY WITH A PLACE, CHOSEN WITH NONE (0.74.6, robin 11-17 (a): Accor's
|
|
45
|
+
// chip on the home): not "nothing could be read" - the page to choose its country or city
|
|
46
|
+
// on, with the cities it is known to have hotels in (`Unanswered.places`). An older card
|
|
47
|
+
// draws the empty list it drew before, its words the same.
|
|
48
|
+
const unplacedGroup = !emptyOfItself && !asked.city && !asked.query && asked.filters?.supplier
|
|
49
|
+
? answer.degraded?.find((d) => d.supplier === asked.filters?.supplier && d.why === 'needs-place')
|
|
50
|
+
: undefined;
|
|
51
|
+
const placeFirst = unplacedGroup
|
|
52
|
+
? {
|
|
53
|
+
supplier: unplacedGroup.supplier,
|
|
54
|
+
name: unplacedGroup.name,
|
|
55
|
+
...(unplacedGroup.names ? { names: unplacedGroup.names } : {}),
|
|
56
|
+
places: (unplacedGroup.places ?? []).map((p) => ({
|
|
57
|
+
name: p.name,
|
|
58
|
+
...(p.names ? { names: p.names } : {}),
|
|
59
|
+
})),
|
|
60
|
+
}
|
|
61
|
+
: undefined;
|
|
62
|
+
const unread = !emptyOfItself && !placeFirst && !!degraded.structured.degraded;
|
|
63
|
+
const why = pastTheEnd
|
|
64
|
+
? `That page is past the end: ${answer.total} match, so \`offset\` 0 to ${answer.total - 1} is where they are.`
|
|
65
|
+
: filteredEmpty
|
|
66
|
+
? emptiedBy(asked.filters ?? {}, answer.beforeFilters ?? 0, deps.vocab.nounPlural)
|
|
67
|
+
: ceilingEmpty && nearest.length
|
|
68
|
+
? `Nothing under ${cap} a night. The cheapest that matched is ${first?.name} at ${cheapest ? formatMoney(cheapest) : '-'}${answer.overBudget && answer.overBudget > 1 ? `, of ${answer.overBudget} over the ceiling` : ''}.`
|
|
69
|
+
: ceilingEmpty
|
|
70
|
+
? `None of the ${answer.beforeCeiling} that match has a room for those nights.`
|
|
71
|
+
: placeFirst
|
|
72
|
+
? `${withZh(placeFirst.name, placeFirst.names, ctx?.noCards)}'s ${deps.vocab.nounPlural} are looked up by country or city, and none was named.`
|
|
73
|
+
: unread
|
|
74
|
+
? `No ${branded(deps.vocab, deps.vocab.nounPlural)} could be read this time.`
|
|
75
|
+
: [
|
|
76
|
+
`No ${branded(deps.vocab, deps.vocab.nounPlural)} match that.`,
|
|
77
|
+
// What was tried and also failed is worth a sentence: it tells a
|
|
78
|
+
// guest the word itself is the problem, not the narrowing.
|
|
79
|
+
widened ? `${sentence(widened.to)} found nothing either.` : '',
|
|
80
|
+
]
|
|
81
|
+
.filter(Boolean)
|
|
82
|
+
.join(' ');
|
|
83
|
+
return {
|
|
84
|
+
structured: {
|
|
85
|
+
view: 'no-hotels',
|
|
86
|
+
...common(deps, key),
|
|
87
|
+
hotels: [],
|
|
88
|
+
total: 0,
|
|
89
|
+
query,
|
|
90
|
+
...(nearest.length ? { nearest, overBudget: answer.overBudget } : {}),
|
|
91
|
+
...(ask.stay ? { stay: ask.stay } : {}),
|
|
92
|
+
...(widened?.found ? { widened } : {}),
|
|
93
|
+
// Nothing found while a group did not answer is not "none here".
|
|
94
|
+
...degraded.structured,
|
|
95
|
+
// Nothing read at all: the card says so, with 「重试」, not "try another city" (U4).
|
|
96
|
+
...(unread ? { unread: true } : {}),
|
|
97
|
+
// The group to choose a place for, and the cities it is known to be in (0.74.6).
|
|
98
|
+
...(placeFirst ? { placeFirst } : {}),
|
|
99
|
+
...(answer.unapplied?.length ? { unapplied: answer.unapplied } : {}),
|
|
100
|
+
// Why it is empty, in the words the model is told, so the card says
|
|
101
|
+
// the same thing rather than guessing at it.
|
|
102
|
+
why,
|
|
103
|
+
// The way back out of a filter that emptied it: the same search -
|
|
104
|
+
// its order, its ceiling and its nights too - with the chips to take
|
|
105
|
+
// one off. Taking one off dropped the sort and the ceiling.
|
|
106
|
+
...(filteredEmpty
|
|
107
|
+
? {
|
|
108
|
+
ask: echo(sort),
|
|
109
|
+
...(answer.refine ? { refine: refineFor(answer.refine, asked.filters, 0) } : {}),
|
|
110
|
+
beforeFilters: answer.beforeFilters,
|
|
111
|
+
}
|
|
112
|
+
: // A market's group asked for and with no hotel here (11-05): the card says
|
|
113
|
+
// which group, and does not send the guest off to "try a city". And
|
|
114
|
+
// nothing read at all (U4): the same search, for the card to ask again
|
|
115
|
+
// and to say where it looked.
|
|
116
|
+
asked.filters?.supplier || unread
|
|
117
|
+
? { ask: echo(sort) }
|
|
118
|
+
: {}),
|
|
119
|
+
},
|
|
120
|
+
text: [
|
|
121
|
+
widened?.found ? `Nothing matched ${widened.from}, so this looked in ${widened.to}.` : '',
|
|
122
|
+
why,
|
|
123
|
+
degraded.said,
|
|
124
|
+
...(answer.unapplied ?? []),
|
|
125
|
+
]
|
|
126
|
+
.filter(Boolean)
|
|
127
|
+
.join(' '),
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=list-hotels-empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-hotels-empty.js","sourceRoot":"","sources":["../../src/tools/list-hotels-empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEzD,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,GAAG,EACH,GAAG,EACH,GAAG,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,GACG,EAAc,EAAE;IACvB,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,GAAG,CAAC;QACJ,OAA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AC,IAAI,CAAC;oBACf,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAChF,aAAa,EAAE,MAAM,CAAC,aAAa;iBACpC;gBACH,CAAC,CAAC,2EAA2E;oBAC3E,oEAAoE;oBACpE,uEAAuE;oBACvE,8BAA8B;oBAC9B,KAAK,CAAC,OAAO,EAAE,QAAQ,IAAI,MAAM;wBACjC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;wBACrB,CAAC,CAAC,EAAE,CAAC;SACV;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,mBAAmB,OAAO,CAAC,IAAI,uBAAuB,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;YACzF,GAAG;YACH,QAAQ,CAAC,IAAI;YACb,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;SAC5B;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolAnswer } from './deps.js';
|
|
2
|
+
import type { ListCx } from './list-hotels-ask.js';
|
|
3
|
+
/** A list with no dates, where the home or a list is priced for tonight: that answer, with what it says first. */
|
|
4
|
+
export declare const pricedForTonight: ({ deps, args, ctx, t, ask, asked, hotels, fitsOnePage, today, tonightLists, }: ListCx) => Promise<ToolAnswer | undefined>;
|
|
5
|
+
/** The whole deployment is one hotel: the home is that hotel's page. */
|
|
6
|
+
export declare const soleHotelAnswer: ({ deps, ctx, t, ask, city, asked, hotels, total, stayArgs, choosing, }: ListCx) => Promise<ToolAnswer | undefined>;
|
|
7
|
+
/** Nothing named: the places to choose from, as regions, countries and cities. */
|
|
8
|
+
export declare const destinationsAnswer: ({ deps, ctx, key, ask, city, who, forPlans, answer, asked, hotels, total, cities, more, places, stayArgs, fromPricesOnly, namedCountry, choosing, today, }: ListCx, facets: NonNullable<ListCx["facets"]>) => ToolAnswer;
|
|
9
|
+
//# sourceMappingURL=list-hotels-home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-hotels-home.d.ts","sourceRoot":"","sources":["../../src/tools/list-hotels-home.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAOnD,kHAAkH;AAClH,eAAO,MAAM,gBAAgB,GAAU,+EAWpC,MAAM,KAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAmDzC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,eAAe,GAAU,wEAWnC,MAAM,KAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CA0BzC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,GAC7B,4JAoBG,MAAM,EACT,QAAQ,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KACpC,UA0GF,CAAC"}
|