@curless/hotel-storefront 0.74.6 → 0.75.1
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/account/index.d.ts +12 -3
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +52 -10
- package/dist/account/index.js.map +1 -1
- package/dist/account/member-login.d.ts +6 -1
- package/dist/account/member-login.d.ts.map +1 -1
- package/dist/account/member-login.js +1 -1
- package/dist/account/member-login.js.map +1 -1
- package/dist/backend.d.ts +21 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/choices.d.ts +16 -17
- package/dist/choices.d.ts.map +1 -1
- package/dist/choices.js +18 -43
- package/dist/choices.js.map +1 -1
- package/dist/huazhu/backend.d.ts +16 -1
- package/dist/huazhu/backend.d.ts.map +1 -1
- package/dist/huazhu/backend.js +39 -4
- package/dist/huazhu/backend.js.map +1 -1
- package/dist/huazhu/catalog.d.ts.map +1 -1
- package/dist/huazhu/catalog.js +20 -0
- package/dist/huazhu/catalog.js.map +1 -1
- package/dist/huazhu/english.d.ts +12 -1
- package/dist/huazhu/english.d.ts.map +1 -1
- package/dist/huazhu/english.js +55 -4
- package/dist/huazhu/english.js.map +1 -1
- package/dist/legal.d.ts +3 -17
- package/dist/legal.d.ts.map +1 -1
- package/dist/legal.js +92 -9
- package/dist/legal.js.map +1 -1
- package/dist/otaless/backend.d.ts +6 -0
- package/dist/otaless/backend.d.ts.map +1 -1
- package/dist/otaless/backend.js +86 -7
- package/dist/otaless/backend.js.map +1 -1
- package/dist/otaless/booking.d.ts +29 -7
- package/dist/otaless/booking.d.ts.map +1 -1
- package/dist/otaless/booking.js +179 -34
- package/dist/otaless/booking.js.map +1 -1
- package/dist/present.d.ts.map +1 -1
- package/dist/present.js +3 -5
- package/dist/present.js.map +1 -1
- package/dist/server.d.ts +21 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +345 -25
- package/dist/server.js.map +1 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +11 -4
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +30 -5
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +231 -97
- package/dist/tools.js.map +1 -1
- package/dist/trip-ids.d.ts +44 -0
- package/dist/trip-ids.d.ts.map +1 -1
- package/dist/trip-ids.js +105 -1
- package/dist/trip-ids.js.map +1 -1
- package/dist/types.d.ts +16 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -75,6 +75,19 @@ const books = (title, openWorld) => ({
|
|
|
75
75
|
idempotentHint: false,
|
|
76
76
|
openWorldHint: openWorld,
|
|
77
77
|
});
|
|
78
|
+
/**
|
|
79
|
+
* Places an order with the hotel's group - a booking, or the guest's agreement that sends it
|
|
80
|
+
* (0.75.0, T3). `destructiveHint: true`: OpenAI's rule gives it to "an irreversible send or a
|
|
81
|
+
* transaction", and that the group lets a booking be cancelled afterwards is not a reason to
|
|
82
|
+
* say false. Not idempotent: a second call is a second order.
|
|
83
|
+
*/
|
|
84
|
+
const orders = (title, openWorld) => ({
|
|
85
|
+
title,
|
|
86
|
+
readOnlyHint: false,
|
|
87
|
+
destructiveHint: true,
|
|
88
|
+
idempotentHint: false,
|
|
89
|
+
openWorldHint: openWorld,
|
|
90
|
+
});
|
|
78
91
|
const cancels = (title, openWorld) => ({
|
|
79
92
|
title,
|
|
80
93
|
readOnlyHint: false,
|
|
@@ -98,6 +111,23 @@ export const LOOK_UP_MAX = 6;
|
|
|
98
111
|
*/
|
|
99
112
|
export const buildTools = (n, v, caps = FULL_CAPABILITIES) => forCapabilities(allTools(n, v), n, v, caps);
|
|
100
113
|
/** The tool names a backend with these capabilities leaves out. */
|
|
114
|
+
/** The list tool's sentence on what it answers asked with no place - every deployment's. */
|
|
115
|
+
const PLACES_SENTENCE = /Asked with no place[\s\S]*?themselves\. /;
|
|
116
|
+
/** The same, where a list without dates is priced for tonight (`listsTonight`) - see `tonightHomeSentence`. */
|
|
117
|
+
const TONIGHT_HOME_SENTENCE = /Asked with no place, it answers with the cities[\s\S]*?asked to see every one\. /;
|
|
118
|
+
/**
|
|
119
|
+
* The most hotels a list priced for tonight by default holds on one page
|
|
120
|
+
* (`listsTonight`, 0.75.1, 总线程 11-18): every one is a price asked of the group - two
|
|
121
|
+
* calls, and its products - so a guest who named no nights waits for twelve at most, and
|
|
122
|
+
* the rest come with the next page. A `limit` above it is taken as this.
|
|
123
|
+
*/
|
|
124
|
+
export const TONIGHT_PAGE_MAX = 12;
|
|
125
|
+
/**
|
|
126
|
+
* What the list tool answers asked with no place, where a list without dates is priced
|
|
127
|
+
* for tonight and there are too many hotels for one page (Huazhu's production, 88 on
|
|
128
|
+
* 2026-11-18): the cities to choose from - the home - and never `all` for it.
|
|
129
|
+
*/
|
|
130
|
+
const tonightHomeSentence = (v) => `Asked with no place, it answers with the cities to choose from, each with how many ${v.nounPlural} it has: that is the home, for a guest who has not said where. Any list here without dates - a city, words, a brand or a filter - is priced for tonight, a page at a time; \`all\` lists every ${v.noun} itself the same way, for a guest who asked to see every one. `;
|
|
101
131
|
/**
|
|
102
132
|
* The list tool where the deployment is one hotel in all (2026-10-15, Huazhu's
|
|
103
133
|
* test system): asked with no place it answers with that hotel's page, not
|
|
@@ -117,7 +147,9 @@ export const homeListing = (t, brand, count) => {
|
|
|
117
147
|
return t;
|
|
118
148
|
const home = count === 1 ? `it answers with that ${v.noun}'s own page` : 'it lists every one of them';
|
|
119
149
|
const one = `This deployment has ${count === 1 ? 'ONE' : count} ${count === 1 ? v.noun : v.nounPlural} in all: asked with no place, or with \`all\`, ${home}; any list here without dates is priced for tonight; and there is no other ${v.noun} or city to list or search. `;
|
|
120
|
-
|
|
150
|
+
// The places sentence as every deployment has it, or as one priced for tonight has it
|
|
151
|
+
// (`tonightHomeSentence`): either way, this one is said instead.
|
|
152
|
+
const places = new RegExp(`${TONIGHT_HOME_SENTENCE.source}|${PLACES_SENTENCE.source}`);
|
|
121
153
|
const schema = t.inputSchema;
|
|
122
154
|
const all = schema?.properties?.all;
|
|
123
155
|
return {
|
|
@@ -174,6 +206,14 @@ export const withheldTools = (n, caps) => new Set([
|
|
|
174
206
|
]
|
|
175
207
|
: []),
|
|
176
208
|
]);
|
|
209
|
+
/**
|
|
210
|
+
* Orders are the ACCOUNT'S (Otaless, 0.75.0 T5/T6): the group's own checkout with booking on.
|
|
211
|
+
* A booking is found by the account that made it - never by a confirmation code and the email
|
|
212
|
+
* it was made with - and what it sends the group is the guest's name, phone, email, dates and
|
|
213
|
+
* rooms and nothing else (no requests, arrival time or notes). So no tool lists an `email` to
|
|
214
|
+
* find one, nor a field the order has nowhere to carry. (`groupCheckout` is only ever Otaless's.)
|
|
215
|
+
*/
|
|
216
|
+
export const ordersByAccount = (caps) => !!caps.groupCheckout && !caps.readOnly;
|
|
177
217
|
/**
|
|
178
218
|
* What to tell a guest who wants to book where nothing can be booked yet
|
|
179
219
|
* (`capabilities.readOnly`) - the same words in the instructions and in each
|
|
@@ -203,6 +243,32 @@ const forCapabilities = (tools, n, v, caps) => {
|
|
|
203
243
|
.filter((t) => !withheld.has(t.name))
|
|
204
244
|
.map((t) => {
|
|
205
245
|
let out = t;
|
|
246
|
+
// ⚠️ A BIG DEPLOYMENT PRICED FOR TONIGHT HAS A HOME OF CITIES, AND `all` IS NOT IT
|
|
247
|
+
// (robin 11-18, 华住生产 at 88 hotels: 「华住首页改成城市选择的吧」 - and a list of all 88,
|
|
248
|
+
// 「选好日期看价格」 on each, was not what opening Huazhu should be). The sentence a
|
|
249
|
+
// deployment of a few has instead is `homeListing`'s, which replaces this one.
|
|
250
|
+
if (caps.listsTonight && !v.market && t.name === n.listHotels) {
|
|
251
|
+
const schema = out.inputSchema;
|
|
252
|
+
const all = schema?.properties?.all;
|
|
253
|
+
out = {
|
|
254
|
+
...out,
|
|
255
|
+
description: out.description.replace(PLACES_SENTENCE, tonightHomeSentence(v)),
|
|
256
|
+
...(schema && all
|
|
257
|
+
? {
|
|
258
|
+
inputSchema: {
|
|
259
|
+
...schema,
|
|
260
|
+
properties: {
|
|
261
|
+
...schema.properties,
|
|
262
|
+
all: {
|
|
263
|
+
...all,
|
|
264
|
+
description: `True lists every ${v.noun} itself, a page at a time - only for a guest who asked to see every one. With nothing named the answer is the cities to choose from, and \`all\` is not the way to it`,
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
}
|
|
269
|
+
: {}),
|
|
270
|
+
};
|
|
271
|
+
}
|
|
206
272
|
// ⚠️ NOTHING TO BOOK, SO NO "TO BOOK" (2026-11-09 audit, T3): a read-only
|
|
207
273
|
// deployment's list is for looking through and picking one.
|
|
208
274
|
if (caps.readOnly && t.name === n.listHotels) {
|
|
@@ -351,7 +417,7 @@ const forCapabilities = (tools, n, v, caps) => {
|
|
|
351
417
|
if (t.name === n.requestBooking && caps.groupCheckout)
|
|
352
418
|
out = {
|
|
353
419
|
...out,
|
|
354
|
-
description: `Books the trip's rooms for a named guest through each hotel group's own checkout, one order per stay with the group that stay belongs to. The group may first send its booking terms back for the guest to read and agree to themselves - on the card or on a one-time page, not in the chat - and its payment page, with its host and the time to pay by, is then in the answer. A stay is booked once it is paid; the bookings list says when it has been
|
|
420
|
+
description: `Books the trip's rooms for a named guest through each hotel group's own checkout, one order per stay with the group that stay belongs to. The group may first send its booking terms back for the guest to read and agree to themselves - on the card or on a one-time page, not in the chat - and its payment page, with its host and the time to pay by, is then in the answer. A stay is booked once it is paid; the bookings list says when it has been.`,
|
|
355
421
|
};
|
|
356
422
|
// A market's suppliers book differently - its own description says so.
|
|
357
423
|
if (t.name === n.requestBooking && caps.booking === 'pay-at-hotel' && !v.market) {
|
|
@@ -370,6 +436,39 @@ const forCapabilities = (tools, n, v, caps) => {
|
|
|
370
436
|
};
|
|
371
437
|
}
|
|
372
438
|
}
|
|
439
|
+
// ⚠️ ORDERS ARE THE ACCOUNT'S (0.75.0, T5/T6; OpenAI: only the data that is needed).
|
|
440
|
+
// Old chats and old cards may still send `email`, `requests`, `arrivingAt` or `notes`:
|
|
441
|
+
// the server takes them and ignores them (`ordersByAccount`).
|
|
442
|
+
if (ordersByAccount(caps)) {
|
|
443
|
+
if (t.name === n.listBookings) {
|
|
444
|
+
out = {
|
|
445
|
+
...out,
|
|
446
|
+
// The account's, in any conversation signed in to it (`otaless/booking.ts`
|
|
447
|
+
// `listBookings`: by the sign-in at each order's group) - and nothing when no one is.
|
|
448
|
+
description: `The bookings of the ${v.brand} account signed in here - made in any conversation signed in to it - newest to oldest, with their status, dates and confirmation codes. Nothing is listed when no account is signed in.`,
|
|
449
|
+
inputSchema: (() => {
|
|
450
|
+
const s = without(out.inputSchema, 'email');
|
|
451
|
+
return {
|
|
452
|
+
...s,
|
|
453
|
+
properties: {
|
|
454
|
+
...s.properties,
|
|
455
|
+
booking: {
|
|
456
|
+
...s.properties.booking,
|
|
457
|
+
description: "A confirmation code of this account's",
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
})(),
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
if (t.name === n.previewCancellation || t.name === n.cancelBooking)
|
|
465
|
+
out = { ...out, inputSchema: without(out.inputSchema, 'email') };
|
|
466
|
+
if (t.name === n.requestBooking || t.name === n.bookPicked)
|
|
467
|
+
out = {
|
|
468
|
+
...out,
|
|
469
|
+
inputSchema: without(out.inputSchema, 'requests', 'arrivingAt', 'notes'),
|
|
470
|
+
};
|
|
471
|
+
}
|
|
373
472
|
// ⚠️ ONE CANCEL, WHICH ASKS THE REFUND TOO (0.74.2, robin 11-17): said by the tool
|
|
374
473
|
// itself, for the model in every client - there is no refund tool to reach for.
|
|
375
474
|
if (t.name === n.cancelBooking && caps.refunds && !caps.readOnly)
|
|
@@ -669,7 +768,7 @@ const allTools = (n, v) => {
|
|
|
669
768
|
: v.demo
|
|
670
769
|
? `Makes a booking request for the trip's rooms, for a named guest: it returns a confirmation code and the moment the hold lapses on its own. ${v.brand} does not receive it and no real room is held. No payment is taken and no card is collected. Preferences - a bed type, a floor, a late arrival - ride along on the request.`
|
|
671
770
|
: `Asks ${v.brand} to hold the trip's rooms for a named guest and returns a confirmation code and the moment the hold lapses. No payment is taken and no card is collected; the rooms are held, not paid for. Preferences - a bed type, a floor, a late arrival - ride along on the booking as requests the desk tries to meet.`,
|
|
672
|
-
annotations:
|
|
771
|
+
annotations: orders(v.market ? `Request a booking on ${v.brand}` : `Request a ${v.brand} booking`, open),
|
|
673
772
|
inputSchema: {
|
|
674
773
|
type: 'object',
|
|
675
774
|
properties: {
|
|
@@ -876,7 +975,7 @@ const allTools = (n, v) => {
|
|
|
876
975
|
},
|
|
877
976
|
{
|
|
878
977
|
name: n.itinerary,
|
|
879
|
-
description: `A day-by-day plan (行程) - one card, in an app that draws one - for a trip of several days, or for days a guest asked to have planned (a city with a span of dates and 行程 is one): the days are laid out by where they are spent, and each part of the trip has a ${v.noun} near those days, chosen from the ${v.nounPlural} read up as text.
|
|
978
|
+
description: `A day-by-day plan (行程) - one card, in an app that draws one - for a trip of several days, or for days a guest asked to have planned (a city with a span of dates and 行程 is one): the days are laid out by where they are spent, and each part of the trip has a ${v.noun} near those days, chosen from the ${v.nounPlural} read up as text. Each day carries its own label, an optional note, the moments of the day in order, and the ${v.nounPlural} and add-ons attached to it, with their details filled in from their own records - a ${v.noun} with its photograph and, given dates, the price of its nights. Each stay is marked with whether it is booked, in the trip or only in the plan, and the answer says how many of each. Nothing is added to the trip.`,
|
|
880
979
|
annotations: reads(v.market ? `Lay out an itinerary on ${v.brand}` : `Lay out a ${v.brand} itinerary`, open),
|
|
881
980
|
inputSchema: {
|
|
882
981
|
type: 'object',
|
|
@@ -1067,7 +1166,7 @@ const allTools = (n, v) => {
|
|
|
1067
1166
|
// room comes from differs (`bookTripLines`).
|
|
1068
1167
|
name: n.bookPicked,
|
|
1069
1168
|
description: "The card's own step when the guest submits the booking form for the room they picked with Reserve: books that one room for the named guest, the way a trip's rooms are booked. Leaves the trip as it is.",
|
|
1070
|
-
annotations:
|
|
1169
|
+
annotations: orders(v.market ? `Book the picked room on ${v.brand}` : `Book the picked ${v.brand} room`, open),
|
|
1071
1170
|
inputSchema: {
|
|
1072
1171
|
type: 'object',
|
|
1073
1172
|
properties: {
|
|
@@ -1097,7 +1196,7 @@ const allTools = (n, v) => {
|
|
|
1097
1196
|
// `ref` only says which terms the card was showing.
|
|
1098
1197
|
name: n.acceptTerms,
|
|
1099
1198
|
description: `The card's own step when the guest presses "Agree and continue" under a hotel group's booking terms: it sends the guest's agreement to the terms behind \`ref\` and the stay is then booked with the group. It answers like a booking: the group's payment page, the terms again, or why nothing was booked.`,
|
|
1100
|
-
annotations:
|
|
1199
|
+
annotations: orders(`Agree to booking terms on ${v.brand}`, open),
|
|
1101
1200
|
inputSchema: {
|
|
1102
1201
|
type: 'object',
|
|
1103
1202
|
properties: {
|
|
@@ -3112,9 +3211,9 @@ const LABEL_WORDS = {
|
|
|
3112
3211
|
const labelWords = (r) => {
|
|
3113
3212
|
const words = [
|
|
3114
3213
|
...(r.labels ?? []).map((l) => LABEL_WORDS[l]),
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3214
|
+
// Paid in advance, and nothing more - not "not booked here" (0.75.1, robin 11-18:
|
|
3215
|
+
// that is said when the guest wants one - `notSoldHereWords`).
|
|
3216
|
+
...(r.payment === 'prepaid' ? ['paid in advance'] : []),
|
|
3118
3217
|
];
|
|
3119
3218
|
return words.length ? ` [${words.join(', ')}]` : '';
|
|
3120
3219
|
};
|
|
@@ -3158,8 +3257,14 @@ const OWN_WHY = {
|
|
|
3158
3257
|
* the structure (2026-10-28). Listed and marked as the group sells them; the
|
|
3159
3258
|
* card says no more than 预付 on them (robin, 2026-10-30), so the assistant is
|
|
3160
3259
|
* the one who knows - and says it when the guest wants one.
|
|
3260
|
+
*
|
|
3261
|
+
* ⚠️ WHEN THE GUEST WANTS ONE, NEVER BEFORE (0.75.1, robin 11-18 on 华住生产: 「这两段话去掉
|
|
3262
|
+
* 吧,预订按钮给我加上,但是跳转的时候再提示暂时还不能预订」): a list or a page says nothing of
|
|
3263
|
+
* it - no sentence first, no "not booked here" on a price (0.65.0 said it before anything was
|
|
3264
|
+
* chosen). The card says it when Reserve is pressed; the assistant when the guest asks to
|
|
3265
|
+
* book one, or when it goes to book one (and the booking is refused, with the same ways on).
|
|
3161
3266
|
*/
|
|
3162
|
-
export const notSoldHereWords = (group) => `Rates marked paid in advance are listed as ${group} sells them, but a stay paid in advance cannot be booked here yet; only rates paid at the hotel can be.
|
|
3267
|
+
export const notSoldHereWords = (group) => `Rates marked paid in advance are listed as ${group} sells them, but a stay paid in advance cannot be booked here yet; only rates paid at the hotel can be. Do not bring that up on your own - show the rates as they are, paid in advance, with nothing said of booking them here. Only when the guest wants one - asks to book it, or you go to book it - say so plainly - nothing is booked or charged - and ${waysOnWords(group, 'a rate paid at the hotel, where this answer lists one')}`;
|
|
3163
3268
|
/**
|
|
3164
3269
|
* Where a guest goes from a rate paid in advance (总线程 11-09, Manus on Huazhu:
|
|
3165
3270
|
* 「选最便宜那个」 was answered "it cannot be booked here" and nothing more,
|
|
@@ -3349,7 +3454,7 @@ readOnly = false) => {
|
|
|
3349
3454
|
};
|
|
3350
3455
|
const pay = readOnly
|
|
3351
3456
|
? { said: '', tags: [] }
|
|
3352
|
-
: paymentOf(rows.map(({ r }) => payOf(r)), 'room'
|
|
3457
|
+
: paymentOf(rows.map(({ r }) => payOf(r)), 'room');
|
|
3353
3458
|
const lowest = Math.min(...rows.map(({ r }) => r.stayTotal.minor));
|
|
3354
3459
|
const apart = {
|
|
3355
3460
|
cheapest: setsApart(rows.map(({ r }) => !r.hourly && r.stayTotal.minor === lowest)),
|
|
@@ -3431,7 +3536,8 @@ readOnly = false) => {
|
|
|
3431
3536
|
said,
|
|
3432
3537
|
blocks,
|
|
3433
3538
|
ids: rows.map(({ r }) => r.id),
|
|
3434
|
-
|
|
3539
|
+
// How it is paid, for the model too (0.75.1: no "not booked here" before the guest wants one).
|
|
3540
|
+
notes: rows.map(({ r }) => (readOnly ? '' : r.notSoldHere ? 'paid in advance' : '')),
|
|
3435
3541
|
};
|
|
3436
3542
|
};
|
|
3437
3543
|
/**
|
|
@@ -3439,7 +3545,7 @@ readOnly = false) => {
|
|
|
3439
3545
|
* id on each line - "— room `x`" - the model was to copy the line and drop its
|
|
3440
3546
|
* end, and on Manus it rewrote the lines and dropped the numbers instead. The
|
|
3441
3547
|
* choices are the guest's as they stand; this line is the model's - and it
|
|
3442
|
-
* marks each one
|
|
3548
|
+
* marks each one paid in advance too (P1-5), where the choices may say it once
|
|
3443
3549
|
* for all.
|
|
3444
3550
|
*/
|
|
3445
3551
|
const idsByNumber = (what, ids, from = 1, notes = []) => `${what} ids by number, for your calls - never for the guest: ${ids
|
|
@@ -3487,10 +3593,10 @@ numbers) => {
|
|
|
3487
3593
|
* The lead, what the rooms share and the choices - in the text and, word for
|
|
3488
3594
|
* word, in `roomChoices`.
|
|
3489
3595
|
*
|
|
3490
|
-
*
|
|
3491
|
-
*
|
|
3492
|
-
*
|
|
3493
|
-
*
|
|
3596
|
+
* `before`: what is said before the list (other arrivals that cost less). Since 0.75.1
|
|
3597
|
+
* (robin 11-18) that rates paid in advance cannot be booked here is not among it: it was
|
|
3598
|
+
* first since robin's Manus run (11-06, via 总线程), and now it is said when the guest wants
|
|
3599
|
+
* one (`notSoldHereWords`).
|
|
3494
3600
|
*/
|
|
3495
3601
|
const roomChoicesOf = (rooms, roomsWanted, when, before, group, readOnly = false) => {
|
|
3496
3602
|
const c = roomChoicesBlock(rooms, roomsWanted, group, readOnly);
|
|
@@ -3504,12 +3610,6 @@ const roomChoicesOf = (rooms, roomsWanted, when, before, group, readOnly = false
|
|
|
3504
3610
|
`\n${idsByNumber('Room', c.ids, 1, c.notes)}`,
|
|
3505
3611
|
];
|
|
3506
3612
|
};
|
|
3507
|
-
/** What is said before the rooms where some - or all - of them are paid in advance and not booked here. */
|
|
3508
|
-
const notSoldFirst = (rooms, notSold) => !notSold
|
|
3509
|
-
? ''
|
|
3510
|
-
: rooms.length > 0 && rooms.every((r) => r.notSoldHere)
|
|
3511
|
-
? `Every rate here for these nights is paid in advance, so none of them can be booked here yet and none is paid at the hotel - the sentence before the rooms says so; keep it first. ${notSold}`
|
|
3512
|
-
: `${notSold} The sentence before the rooms says which are not bookable here; keep it before them.`;
|
|
3513
3613
|
/**
|
|
3514
3614
|
* What a hotel's rooms look like to the assistant for the nights: one line per
|
|
3515
3615
|
* type, and with filters only the rates that meet ALL of them. None meeting
|
|
@@ -3524,8 +3624,8 @@ when, enough, roomsWanted, terms, noCards,
|
|
|
3524
3624
|
/** The nights as the guest reads them - weekdays first - for a client that draws no card. */
|
|
3525
3625
|
saidWhen,
|
|
3526
3626
|
/**
|
|
3527
|
-
* What is said before the list to a client that draws no card:
|
|
3528
|
-
*
|
|
3627
|
+
* What is said before the list to a client that draws no card: other arrivals
|
|
3628
|
+
* that cost less (`dateFlex`).
|
|
3529
3629
|
*/
|
|
3530
3630
|
before,
|
|
3531
3631
|
/** The group a stay paid in advance is booked with instead - see `paymentOf`. */
|
|
@@ -4198,6 +4298,10 @@ const soldOutTypesOf = (detail, enough, wanted) => {
|
|
|
4198
4298
|
...(left > 0 ? { left } : {}),
|
|
4199
4299
|
}));
|
|
4200
4300
|
};
|
|
4301
|
+
/** A code that opens no booking here: where orders are the account's, no email would have opened it. */
|
|
4302
|
+
const noBookingLike = (deps) => ordersByAccount(deps.backend.capabilities ?? FULL_CAPABILITIES)
|
|
4303
|
+
? 'No booking here matches that code. Only bookings made here by this account are known.'
|
|
4304
|
+
: 'No booking here matches that code. A booking made in another conversation needs the email it was made with.';
|
|
4201
4305
|
const identity = (deps, ctx, key, args = {}) => {
|
|
4202
4306
|
const email = str(args.email);
|
|
4203
4307
|
const member = deps.members.read(key);
|
|
@@ -5442,7 +5546,7 @@ const hotelChoicesBlock = (hotels,
|
|
|
5442
5546
|
offset,
|
|
5443
5547
|
/** The group a hotel is with, in a market - its name is ours, not the backend's code. */
|
|
5444
5548
|
groupOf,
|
|
5445
|
-
/** The group a
|
|
5549
|
+
/** The deployment's group, where a hotel's own is not known. */
|
|
5446
5550
|
group,
|
|
5447
5551
|
/** Nothing can be booked here (`capabilities.readOnly`): said once, and no payment told apart. */
|
|
5448
5552
|
readOnly = false) => {
|
|
@@ -5478,7 +5582,7 @@ readOnly = false) => {
|
|
|
5478
5582
|
const cancel = spreadOf(priced.map(cancelOf));
|
|
5479
5583
|
const pay = readOnly
|
|
5480
5584
|
? { said: '', tags: [] }
|
|
5481
|
-
: paymentOf(priced.map((h) => payOf(h.forStay ?? {})), 'hotel'
|
|
5585
|
+
: paymentOf(priced.map((h) => payOf(h.forStay ?? {})), 'hotel');
|
|
5482
5586
|
const payTag = (h) => (h.forStay ? (pay.tags[priced.indexOf(h)] ?? '') : '');
|
|
5483
5587
|
// The cheapest, in one currency, and the best rated - among more than one.
|
|
5484
5588
|
const priceOf = (h) => h.forStay?.total ?? h.fromNightly;
|
|
@@ -5586,7 +5690,8 @@ readOnly = false) => {
|
|
|
5586
5690
|
return {
|
|
5587
5691
|
said,
|
|
5588
5692
|
blocks,
|
|
5589
|
-
|
|
5693
|
+
// How its price is paid (0.75.1: no "not booked here" before the guest wants one).
|
|
5694
|
+
notes: hotels.map((h) => !readOnly && h.forStay?.notSoldHere ? 'its price is paid in advance' : ''),
|
|
5590
5695
|
};
|
|
5591
5696
|
};
|
|
5592
5697
|
/**
|
|
@@ -5630,11 +5735,8 @@ const comparedInWords = (c) => {
|
|
|
5630
5735
|
: p.refundable
|
|
5631
5736
|
? 'no free cancellation'
|
|
5632
5737
|
: 'non-refundable',
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
? 'paid in advance - not booked here'
|
|
5636
|
-
: 'paid in advance'
|
|
5637
|
-
: '',
|
|
5738
|
+
// Paid in advance, and nothing more (0.75.1 - `notSoldHereWords`).
|
|
5739
|
+
p.payment === 'prepaid' ? 'paid in advance' : '',
|
|
5638
5740
|
p.breakfast ? 'breakfast included' : 'no breakfast',
|
|
5639
5741
|
]
|
|
5640
5742
|
.filter(Boolean)
|
|
@@ -6721,6 +6823,8 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
6721
6823
|
? Math.max(1, Math.min(MAX_ROOMS_PER_LINE, Math.floor(args.rooms)))
|
|
6722
6824
|
: undefined,
|
|
6723
6825
|
filters: filtersOf(args),
|
|
6826
|
+
// Tonight by default: the page alone is priced (`listsTonight`, below).
|
|
6827
|
+
...(ctx.pricePageOnly ? { pricePageOnly: true } : {}),
|
|
6724
6828
|
};
|
|
6725
6829
|
// A group as a guest names it, to the id the market files it under.
|
|
6726
6830
|
const named = ask.filters?.supplier ? groupNamed(deps, ask.filters.supplier) : undefined;
|
|
@@ -6954,32 +7058,61 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
6954
7058
|
// per hotel (six at most). A group of many still chooses a city first and
|
|
6955
7059
|
// lists twenty at a time without prices, a market its group; rooms by the
|
|
6956
7060
|
// hour are today's by their own rule; dates the model gave are used as given.
|
|
6957
|
-
|
|
7061
|
+
//
|
|
7062
|
+
// ⚠️ AND IN A DEPLOYMENT PRICED FOR TONIGHT, AT ANY SIZE (`listsTonight`, 0.75.1 -
|
|
7063
|
+
// robin 11-18 at Huazhu's 88: 「怎么变成要选日期了,不是默认当天的吗」). Its home is still
|
|
7064
|
+
// the cities to choose from, unpriced (`choosing`); every list - a city, words, a brand,
|
|
7065
|
+
// a filter, `all` - is tonight's, priced: this page only, at most TONIGHT_PAGE_MAX,
|
|
7066
|
+
// through the group's own limit on calls and its minute of kept prices. A hotel whose
|
|
7067
|
+
// price cannot be read is listed without one, said as that (`noRoomsForStayCode`
|
|
7068
|
+
// 'unreachable'); a list that cannot be priced at all is the list as it was.
|
|
7069
|
+
const tonightLists = !fitsOnePage &&
|
|
7070
|
+
!choosing &&
|
|
7071
|
+
deps.backend.capabilities?.listsTonight === true &&
|
|
7072
|
+
!deps.backend.suppliers &&
|
|
7073
|
+
!deps.vocab.market;
|
|
7074
|
+
if ((fitsOnePage || tonightLists) &&
|
|
7075
|
+
!ask.stay &&
|
|
7076
|
+
!ask.filters?.hourly &&
|
|
7077
|
+
hotels.length &&
|
|
7078
|
+
today?.min) {
|
|
6958
7079
|
const tonight = {
|
|
6959
7080
|
checkIn: today.min,
|
|
6960
7081
|
checkOut: addDays(today.min, 1),
|
|
6961
7082
|
guests: guestsOf(args),
|
|
6962
7083
|
};
|
|
6963
|
-
const
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
// ⚠️ TO A CLIENT THAT DRAWS NO CARD, THE OTHER NIGHTS ARE NAMED BY THEIR
|
|
6969
|
-
// DATES (robin 11-06): the card has a date bar to change; in words it is
|
|
6970
|
-
// the reply's first sentence - see `stayDefaultWords`.
|
|
6971
|
-
const stayDefault = ctx.noCards
|
|
6972
|
-
? stayDefaultWords(tonight.checkIn, tonight.guests, roomCount, 'hotels')
|
|
6973
|
-
: `No dates were asked for, so this opens on tonight by default: ${tonight.checkIn} to ${tonight.checkOut} (one night, on the hotels' own date), ${tonight.guests} ${tonight.guests === 1 ? 'guest' : 'guests'}, ${roomCount === 1 ? 'one room' : `${roomCount} rooms`} - every price here is for that night. Say so: the prices shown are tonight's, and the guest can change the dates on the card or name others. Do not ask for dates before showing them.`;
|
|
6974
|
-
// Right after what is here - "every one, and no others" stays the first thing said.
|
|
6975
|
-
const inAll = String(priced.structured.inAll ?? '');
|
|
6976
|
-
return {
|
|
6977
|
-
...priced,
|
|
6978
|
-
structured: { ...priced.structured, stayDefault },
|
|
6979
|
-
text: inAll && priced.text.startsWith(inAll)
|
|
6980
|
-
? `${inAll} ${stayDefault}${priced.text.slice(inAll.length)}`
|
|
6981
|
-
: `${stayDefault}\n\n${priced.text}`,
|
|
7084
|
+
const pageAsked = typeof args.limit === 'number' ? args.limit : DEFAULT_PAGE;
|
|
7085
|
+
const tonightArgs = {
|
|
7086
|
+
...args,
|
|
7087
|
+
...tonight,
|
|
7088
|
+
...(tonightLists ? { limit: Math.min(pageAsked, TONIGHT_PAGE_MAX) } : {}),
|
|
6982
7089
|
};
|
|
7090
|
+
// Where the deployment is priced for tonight at any size, a list that could not be
|
|
7091
|
+
// priced at all is the list as it was - never no list (a deployment of a few as before).
|
|
7092
|
+
const priced = tonightLists
|
|
7093
|
+
? await answerTool(deps, t.listHotels, tonightArgs, { ...ctx, pricePageOnly: true }).then((a) => (a.isError ? undefined : a), () => undefined)
|
|
7094
|
+
: await answerTool(deps, t.listHotels, tonightArgs, ctx);
|
|
7095
|
+
if (priced) {
|
|
7096
|
+
// ⚠️ THE ROOMS ASKED FOR, not "one room" (2026-11-03 review, C12): `rooms: 2`
|
|
7097
|
+
// rides along into the priced list, and every price in it is two rooms'.
|
|
7098
|
+
const roomCount = ask.rooms ?? 1;
|
|
7099
|
+
// In both, in the same words: the model reads the structure.
|
|
7100
|
+
// ⚠️ TO A CLIENT THAT DRAWS NO CARD, THE OTHER NIGHTS ARE NAMED BY THEIR
|
|
7101
|
+
// DATES (robin 11-06): the card has a date bar to change; in words it is
|
|
7102
|
+
// the reply's first sentence - see `stayDefaultWords`.
|
|
7103
|
+
const stayDefault = ctx.noCards
|
|
7104
|
+
? stayDefaultWords(tonight.checkIn, tonight.guests, roomCount, 'hotels')
|
|
7105
|
+
: `No dates were asked for, so this opens on tonight by default: ${tonight.checkIn} to ${tonight.checkOut} (one night, on the hotels' own date), ${tonight.guests} ${tonight.guests === 1 ? 'guest' : 'guests'}, ${roomCount === 1 ? 'one room' : `${roomCount} rooms`} - every price here is for that night. Say so: the prices shown are tonight's, and the guest can change the dates on the card or name others. Do not ask for dates before showing them.`;
|
|
7106
|
+
// Right after what is here - "every one, and no others" stays the first thing said.
|
|
7107
|
+
const inAll = String(priced.structured.inAll ?? '');
|
|
7108
|
+
return {
|
|
7109
|
+
...priced,
|
|
7110
|
+
structured: { ...priced.structured, stayDefault },
|
|
7111
|
+
text: inAll && priced.text.startsWith(inAll)
|
|
7112
|
+
? `${inAll} ${stayDefault}${priced.text.slice(inAll.length)}`
|
|
7113
|
+
: `${stayDefault}\n\n${priced.text}`,
|
|
7114
|
+
};
|
|
7115
|
+
}
|
|
6983
7116
|
}
|
|
6984
7117
|
// ⚠️ ONE HOTEL IS NO CHOICE OF PLACES (robin, 2026-10-15: 「现在只有杭州一家
|
|
6985
7118
|
// 了,首页也要改」). Huazhu's test system has one hotel, and "where to?" over
|
|
@@ -7070,11 +7203,23 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7070
7203
|
}, new Map())
|
|
7071
7204
|
.values(),
|
|
7072
7205
|
].sort((a, b) => b.count - a.count);
|
|
7206
|
+
// The places page counts a group asked only with a place where it is known to have hotels (0.75.1).
|
|
7207
|
+
const placesTotal = total + (answer.elsewhere ?? 0);
|
|
7208
|
+
// ⚠️ ONE COUNTRY IS A CHOICE OF CITIES (robin 11-18, Huazhu's 88 in 32 cities, all in
|
|
7209
|
+
// China: 「华住首页改成城市选择的吧」). "88 hotels in 32 cities across 1 country, to choose
|
|
7210
|
+
// from by region, country and city - Asia: China (88)" named no city the guest could
|
|
7211
|
+
// choose. Where a list is priced for tonight (`listsTonight`), every city, counted - with
|
|
7212
|
+
// a card and without - and what choosing one does.
|
|
7213
|
+
const cityHome = deps.backend.capabilities?.listsTonight === true &&
|
|
7214
|
+
!deps.backend.suppliers &&
|
|
7215
|
+
!deps.vocab.market &&
|
|
7216
|
+
countries.length === 1 &&
|
|
7217
|
+
facets.cities.length > 1;
|
|
7073
7218
|
return {
|
|
7074
7219
|
structured: {
|
|
7075
7220
|
view: 'destinations',
|
|
7076
7221
|
...common(deps, key),
|
|
7077
|
-
total,
|
|
7222
|
+
total: placesTotal,
|
|
7078
7223
|
regions,
|
|
7079
7224
|
ask: { ...stayArgs },
|
|
7080
7225
|
...(ask.stay ? { stay: ask.stay } : {}),
|
|
@@ -7094,7 +7239,9 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7094
7239
|
// groups that did not answer, by name; no places, no plans.
|
|
7095
7240
|
text: total === 0
|
|
7096
7241
|
? `There are no ${n} to show right now.${degraded.said ? ` ${degraded.said}` : ''}`
|
|
7097
|
-
:
|
|
7242
|
+
: cityHome
|
|
7243
|
+
? `${placesTotal} ${branded(deps.vocab, n)} in ${facets.cities.length} cities, to choose from by city: ${every(facets.cities)}. A city lists its ${n}, priced for tonight unless other nights are named; \`all\` lists every one, a page at a time - only for a guest who asked to see every one. ${degraded.said ? `${degraded.said} ` : ''}${forPlans}`
|
|
7244
|
+
: `${placesTotal} ${branded(deps.vocab, n)} in ${facets.cities.length} cities across ${countries.length} ${countries.length === 1 ? 'country' : 'countries'}, to choose from by region, country and city - ${regions.map((r) => `${r.name}: ${ctx.noCards ? everyWithCities(r.countries) : every(r.countries)}`).join('; ')}. A city or a country lists its ${n}. ${degraded.said ? `${degraded.said} ` : ''}${forPlans}`,
|
|
7098
7245
|
};
|
|
7099
7246
|
}
|
|
7100
7247
|
if (hotels.length === 0) {
|
|
@@ -7335,20 +7482,12 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7335
7482
|
: '',
|
|
7336
7483
|
].filter(Boolean);
|
|
7337
7484
|
// A price on the list that is not booked here (`notSoldHere`): said as on
|
|
7338
|
-
// the hotel's page, in both - see `notSoldHereWords`.
|
|
7485
|
+
// the hotel's page, in both - see `notSoldHereWords`. ⚠️ NOT FIRST ANY MORE (0.75.1,
|
|
7486
|
+
// robin 11-18): 0.58.2 had a list whose every price was one say so before the list
|
|
7487
|
+
// (总线程 11-09, Manus: 「选最便宜那个」 met "it cannot be booked here" and nothing more);
|
|
7488
|
+
// now it is said when the guest wants one, with the ways on - as on the hotel's page.
|
|
7339
7489
|
const notSoldOn = hotels.find((h) => h.forStay?.notSoldHere);
|
|
7340
|
-
|
|
7341
|
-
// Huazhu's production): one hotel, its one price paid in advance, and the
|
|
7342
|
-
// guest's 「选最便宜那个」 met "it cannot be booked here" and nothing more.
|
|
7343
|
-
const pricedHere = hotels.filter((h) => h.forStay);
|
|
7344
|
-
const allPrepaid = pricedHere.length > 0 && pricedHere.every((h) => h.forStay?.notSoldHere);
|
|
7345
|
-
const notSold = notSoldOn
|
|
7346
|
-
? `${allPrepaid
|
|
7347
|
-
? `Every price in this list is a rate paid in advance, which cannot be booked here - say that first, before the list. A ${deps.vocab.noun}'s own page (${deps.tools.getHotel}) lists the rates it has paid at the hotel, if it has any. `
|
|
7348
|
-
: ''}${notSoldHereWords(groupNameOf(deps, notSoldOn.id))}`
|
|
7349
|
-
: '';
|
|
7350
|
-
if (notSold)
|
|
7351
|
-
priceNotes.push(notSold);
|
|
7490
|
+
const notSold = notSoldOn ? notSoldHereWords(groupNameOf(deps, notSoldOn.id)) : '';
|
|
7352
7491
|
// To a client that draws no card, the hotels as numbered lines - numbered
|
|
7353
7492
|
// across pages, so "the 23rd" on the second page is still one hotel. In the
|
|
7354
7493
|
// text and, word for word, in the structure (`hotelChoices`).
|
|
@@ -7476,6 +7615,8 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7476
7615
|
widened?.found ? `Nothing matched ${widened.from}, so this is ${widened.to}.` : '',
|
|
7477
7616
|
degraded.said,
|
|
7478
7617
|
hotelChoices ? `\n${LIST_NOT_DRAWN}\n${hotelChoices}\n` : '',
|
|
7618
|
+
// After the hotels, never before them: for when the guest wants one (0.75.1).
|
|
7619
|
+
notSold,
|
|
7479
7620
|
ctx.drawsCards && hotels.length ? ON_CARD.hotels : '',
|
|
7480
7621
|
forPlans,
|
|
7481
7622
|
]
|
|
@@ -7693,14 +7834,9 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7693
7834
|
? `${flex.text} (That is the cheapest room of any kind, not only one with ${termWords(terms)}.)`
|
|
7694
7835
|
: flex.text;
|
|
7695
7836
|
// ⚠️ BEFORE THE LIST, NOT AFTER IT (总线程 11-06, robin's Manus run): "arriving
|
|
7696
|
-
// the 18th is ¥253 less", last in the answer, was never passed on
|
|
7697
|
-
//
|
|
7698
|
-
const before =
|
|
7699
|
-
notSoldFirst(choosable, notSold),
|
|
7700
|
-
flexSaid ? `${flexSaid} Say that in one sentence before the list too.` : '',
|
|
7701
|
-
]
|
|
7702
|
-
.filter(Boolean)
|
|
7703
|
-
.join(' ');
|
|
7837
|
+
// the 18th is ¥253 less", last in the answer, was never passed on. (Rates not booked
|
|
7838
|
+
// here are no longer said before it - 0.75.1, `notSoldHereWords`.)
|
|
7839
|
+
const before = flexSaid ? `${flexSaid} Say that in one sentence before the list too.` : '';
|
|
7704
7840
|
const saidWhen = byTheHour
|
|
7705
7841
|
? `today, ${dayWords(stay.checkIn)}, ${stay.guests} ${stay.guests === 1 ? 'guest' : 'guests'}`
|
|
7706
7842
|
: `${stayDayWords(stay.checkIn, stay.checkOut)}, ${stay.guests} ${stay.guests === 1 ? 'guest' : 'guests'}${roomsWanted > 1 ? `, ${roomsWanted} rooms` : ''}`;
|
|
@@ -7749,7 +7885,8 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7749
7885
|
`${offerCount(rs)} for ${ctx.noCards ? `${stayDayWords(stay.checkIn, stay.checkOut)}, ${stay.checkIn} to ${stay.checkOut}` : `${stay.checkIn} to ${stay.checkOut}`}, ${stay.guests} guests${roomsWanted > 1 ? `, ${roomsWanted} rooms` : ''}`, byTheHour ? `today, ${stay.checkIn}` : `${stay.checkIn} to ${stay.checkOut}`, enough, roomsWanted, terms, ctx.noCards, saidWhen, before, groupNameOf(deps, h.id), !!notBookable),
|
|
7750
7886
|
// Said before the list to a client that draws no card (`before`).
|
|
7751
7887
|
ctx.noCards && choosable.length ? '' : flexSaid,
|
|
7752
|
-
|
|
7888
|
+
// After the rooms, never before them: for when the guest wants one (0.75.1).
|
|
7889
|
+
notSold,
|
|
7753
7890
|
ctx.drawsCards && enough.length ? ON_CARD.rooms : '',
|
|
7754
7891
|
]
|
|
7755
7892
|
.filter(Boolean)
|
|
@@ -7944,9 +8081,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7944
8081
|
query: code,
|
|
7945
8082
|
...(tooMany ? { tooMany: true } : {}),
|
|
7946
8083
|
},
|
|
7947
|
-
text: tooMany
|
|
7948
|
-
? TOO_MANY_TRIES
|
|
7949
|
-
: 'No booking here matches that code. A booking made in another conversation needs the email it was made with.',
|
|
8084
|
+
text: tooMany ? TOO_MANY_TRIES : noBookingLike(deps),
|
|
7950
8085
|
};
|
|
7951
8086
|
}
|
|
7952
8087
|
const wanted = booked ? booked.hotelId : str(args.hotel);
|
|
@@ -8277,9 +8412,11 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8277
8412
|
// Read here, before a filter or a spread drops it: the groups whose
|
|
8278
8413
|
// bookings are not in `here` (2026-11-03 review, C5).
|
|
8279
8414
|
const missing = degradedOf(deps, { degraded: here.degraded }, 'bookings', ctx?.noCards);
|
|
8280
|
-
// Elsewhere, only with the code AND the email - see `listBookings`.
|
|
8415
|
+
// Elsewhere, only with the code AND the email - see `listBookings`. Where orders are the
|
|
8416
|
+
// account's (Otaless), the code alone finds this account's own, and an email is not asked.
|
|
8417
|
+
const byAccount = ordersByAccount(deps.backend.capabilities ?? FULL_CAPABILITIES);
|
|
8281
8418
|
const code = str(args.booking);
|
|
8282
|
-
const { found: there, tooMany } = code && str(args.email)
|
|
8419
|
+
const { found: there, tooMany } = code && (str(args.email) || byAccount)
|
|
8283
8420
|
? await guarded(deps, ctx, who, code, () => deps.backend.findBooking(code, who))
|
|
8284
8421
|
: { found: null, tooMany: false };
|
|
8285
8422
|
const bookings = there && !here.some((b) => b.id === there.id) ? [there, ...here] : here;
|
|
@@ -8289,9 +8426,11 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8289
8426
|
const missed = code && !there;
|
|
8290
8427
|
const missLine = tooMany
|
|
8291
8428
|
? TOO_MANY_TRIES
|
|
8292
|
-
:
|
|
8293
|
-
? '
|
|
8294
|
-
:
|
|
8429
|
+
: byAccount
|
|
8430
|
+
? 'No booking of this account matches that confirmation code.'
|
|
8431
|
+
: code && !str(args.email)
|
|
8432
|
+
? 'A booking made elsewhere needs the email it was made with as well as its code.'
|
|
8433
|
+
: 'No booking matches that confirmation code and email. Both are needed, as they are on the confirmation.';
|
|
8295
8434
|
return {
|
|
8296
8435
|
structured: {
|
|
8297
8436
|
view: 'bookings',
|
|
@@ -8313,7 +8452,9 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8313
8452
|
: // ⚠️ NOT "NO BOOKINGS" when a group did not answer: it may hold them.
|
|
8314
8453
|
missing.said
|
|
8315
8454
|
? ''
|
|
8316
|
-
:
|
|
8455
|
+
: byAccount
|
|
8456
|
+
? 'No bookings on this account.'
|
|
8457
|
+
: 'No bookings in this conversation. A booking made elsewhere is found with its confirmation code and the email it was made with.',
|
|
8317
8458
|
missing.said,
|
|
8318
8459
|
]
|
|
8319
8460
|
.filter(Boolean)
|
|
@@ -8445,9 +8586,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8445
8586
|
query: ref,
|
|
8446
8587
|
...(tooMany ? { tooMany: true } : {}),
|
|
8447
8588
|
},
|
|
8448
|
-
text: tooMany
|
|
8449
|
-
? TOO_MANY_TRIES
|
|
8450
|
-
: 'No booking here matches that code. A booking made in another conversation needs the email it was made with.',
|
|
8589
|
+
text: tooMany ? TOO_MANY_TRIES : noBookingLike(deps),
|
|
8451
8590
|
};
|
|
8452
8591
|
}
|
|
8453
8592
|
const stayOf = (x) => ({
|
|
@@ -8575,9 +8714,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8575
8714
|
query: ref,
|
|
8576
8715
|
...(tooMany ? { tooMany: true } : {}),
|
|
8577
8716
|
},
|
|
8578
|
-
text: tooMany
|
|
8579
|
-
? TOO_MANY_TRIES
|
|
8580
|
-
: 'No booking here matches that code. A booking made in another conversation needs the email it was made with.',
|
|
8717
|
+
text: tooMany ? TOO_MANY_TRIES : noBookingLike(deps),
|
|
8581
8718
|
};
|
|
8582
8719
|
}
|
|
8583
8720
|
// What is being cancelled, and on what terms, for the card to say in the
|
|
@@ -8975,11 +9112,8 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
8975
9112
|
: ctx.noCards && x.freeCancellationUntil
|
|
8976
9113
|
? `free to cancel until ${freeUntilText(x)}`
|
|
8977
9114
|
: '',
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
? 'paid in advance - not booked here'
|
|
8981
|
-
: 'paid in advance'
|
|
8982
|
-
: '',
|
|
9115
|
+
// Paid in advance, and nothing more (0.75.1 - `notSoldHereWords`).
|
|
9116
|
+
x.payment === 'prepaid' ? 'paid in advance' : '',
|
|
8983
9117
|
]
|
|
8984
9118
|
.filter(Boolean)
|
|
8985
9119
|
.join(', ');
|